[jifty-devel] passing in args to page regions which include forms

Andrew Sterling Hanenkamp sterling at hanenkamp.com
Tue Jul 10 09:57:31 EDT 2007


Believe it. Every action parameter to an action is encoded like this:

J:A:F-parent-auto-85bdf599148e8e96c00c26dfc4cb6724-1-S572764

This way action parameters can be processed automatically, linked with
the submitted action or ignored for a non-submitted action, etc. Your
templates want a parameter named:

parent

So you need to set that somehow. The usual way is to load whatever you
need (possibly using the result of the action) and add:

set parent => $parent;

in your dispatcher.

On 7/9/07, Matthew Lenz <matthew at nocturnal.org> wrote:
> On Sun, 2007-07-08 at 15:19 -0400, Nelson Elhage wrote:
> > > Still looking for a solution to the following problem.  Nelson's
> > > suggestion works partially but I still get an error when it tries to
> > > reload.  I have other forms that work fine where all the information is
> > > specified in the form.  This seems to be directly linked to needing to
> > > insert the fk from a param value.  full code examples of the action are
> > > in my original post.
> > >
> > > [elided]
> > > > This works partially but dies upon upon submit.  reloading the server
> > > > shows that the data was added to the db properly though.  Here is the
> > > > error:
> > > >
> > > > FATAL - view class error: no value sent for required parameter 'parent'
> > > > Stack:
> > > >   [/usr/local/share/perl/5.8.8/auto/Jifty/web/templates/autohandler:10]
> > > >
> > > > FATAL - view class error: ABORT
> > > > at /usr/local/share/perl/5.8.8/Jifty/Dispatcher.pm line 748.
> > > >
> >
> > This looks to me like you're trying to show a template that expects a
> > C<parent> argument in its C<< <%ARGS> >> section, but you're not giving
> > it one, by using C<< set parent => ... >> in the dispatcher.
> >
> > The arguments to actions and to templates are completely different
> > namespaces and have no direct relation to each other -- neither will
> > cause the other to autopopulate; It's your job in the dispatcher and
> > template to make sure things get routed to each appropriately.
> >
> > Hope this helps,
> >
> > - Nelson
>
> http://lists.bestpractical.com/pipermail/jifty-devel/2007-July/001515.html
>
> my original post contains exactly what I'm trying to do.  I just can't
> believe that Jifty would be designed to make someone jump through that
> many hoops.  I have to use the dispatcher just to pass around id's that
> I would like to use as hidden form elements?  Is the issue that I'm
> trying to do so using a page region/fragment?  Shouldn't I be able to do
> all this stuff just using mason templates?  You can do just about
> anything in the <init> block that you can do in the dispatcher right?
> The tutorial is incredibly misleading if that isn't the case.
>
> > _______________________________________________
> > jifty-devel mailing list
> > jifty-devel at lists.jifty.org
> > http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
>
> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
>


More information about the jifty-devel mailing list