[jifty-devel] Action in a link? Without a <form>?

jpollack at gmail.com jpollack at gmail.com
Mon Feb 26 15:00:28 EST 2007


Hi all,

I'd like to be able to click on a link, and have that cause an action
(with arguments) to be run, while remaining on the current page.  Does
anyone know how I can do this?

If you set submit => $action when making the J:W:Form:Clickable (as
the documentation suggests), but don't need an enclosing <form>
(because all arguments were specified during construction of the
action), then I've found the rendered link fails to do anything
useful.  Both as_link and as_button, clicking it results in nothing.

I've hacked together something crude where I tangent to a page which
contains $a = new_action; $a->run; jifty->web->return, which works,
but causes the whole page to reload, which destroys any state I have
in my regions.  Besides, it's ugly.

Someone on IRC suggested months ago that I try to do something
involving putting the action in a request or continuation, and then
making the link call that.  Can anyone offer any ideas or suggestions
on how to do this?  I've tried several things with continuations
(putting the action in a request in the continuation, putting the
action generation and execution in the 'code' block) all to no
success.

Should someone show me how to do this, I'd be happy to write
documentation for it. ; )

Thanks,
Joshua


More information about the jifty-devel mailing list