[jifty-devel] Continuations with URL query parameters

Alex Vandiver alexmv at bestpractical.com
Sun Dec 10 21:58:45 EST 2006

On Sun, 2006-12-10 at 18:29 -0500, Sean E. Millichamp wrote:
> I go to the URL: http://localhost:8888/host/index.html
> Then I click on "Detail", which ends up being a link to something like: 
> http://localhost:8888/host/?J:CREATE=1;J:PATH=/host/detail?hostid=2
> The detail page shows fine.  Then I click on the "Add" link which does a
> tangent to /host/createnetwork.  When it returns I get sent back
> to /host/detail, but hostid=2 is no longer passed in to <%args> and I
> get a Mason error of "no value sent for required parameter 'hostid'".
> My question is: how can I do this (pass simple state through) and have
> continuations preserve it?  I thought 'tangent' was supposed to do that,
> but it doesn't seem to preserve URL query parameters.  Is that a bug or
> am I just going about this the wrong way?

Hrm.  The problem is that the "Add" link should be preserving all of the
state of the original request page, including the hostid=2, and that
it's not.  In an idea world, you'd save the continuation of the page
when you *arrived* at it -- to save on space (not saving a continuation
for *every* page hit!) we re-request the same page when you click on the
link to tangent -- but it happens that we're not re-creating and sending
every parameter of the request.  That might be considerable as a bug.
Perhaps the preserve_state => 1 argument in Jifty::Web::Form::Clickable
should pull *all* HTTP variables into the link, not just state

On that note, check out state variables to see if they'll do what you
want (Jifty->web->get_variable, Jifty->web->set_variable,
Jifty::Web::Clickable->state_variable).  State variables were an
interesting though early on, which fragments were layered on top of,
which not much work has been done with state variables by themselves, so
they might need some love to work the way you want.
 - Alex

More information about the jifty-devel mailing list