[jifty-devel] Continuations and Actions

Sterling Hanenkamp sterling at hanenkamp.com
Sun Jun 15 23:13:56 EDT 2008


On Tue, Apr 1, 2008 at 5:04 AM, Mikko Lipasti <mikko.lipasti at polarcom.fi>
wrote:

> > Yes it does. What would be the best way to do 2.5? Can I submit an action
> using a link, other than masquerading form submission using
> $button->as_link.
> >
> > Perhaps serializing the action submission into GET args would work but I
> don't know how to do that..
>
> Ideas, anyone?


(Mikko, sorry for answering late. I'm not sure I was the best authority and
I've been looking for a/starting a new job since the beginning of March.)

First, I want to answer the question and then I want ask it again in a new
context.

The answer is pretty straightforward, to send an action with a request, you
just need to submit the action again. For example:

Jifty->web->link(
    label => 'View Details',
    url => '/search_and_detail',
    submit => Jifty->web->request->action('search-results'),
);

Any action that has been processed for the current request can be submitted
again and will be processed with the next request again. To perform the
intermediate jump, you can call tangent() from within a before rule of the
dispatcher.

before 'search_and_detail' => run {
    tangent('detail');
};
on 'detail' => run { ... };

You can get the gist of all this from Jifty::Manual::Continuations. (I'm
mostly quoting that since I have not directly tested it recently, so if I'm
wrong, then this has changed.)

Now, my question is this: how do you do the same thing from within an
onclick handler that replaces a region?

I haven't figured out the right combination for saving a continuation
containing an action within the webservices call. I'm going through and
tracing out where continuations are saved and called out of requests as
generalized in the flow chart shown in Jifty::Manual::Continuations to learn
how this works in detail, but if someone can give me a hint in the meantime,
that'd be great.

Cheers,
Sterling

P.S. Look for me at the Grant Street Group booth at YAPC::NA. I won't be
making it in person :( , but I'm the poster child for their push to hire
telecommuting Perl hackers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jifty.org/pipermail/jifty-devel/attachments/20080615/76be3176/attachment.htm 


More information about the jifty-devel mailing list