[jifty-devel] Suggested API change for clickables/onclick handlers

Jesse Vincent jesse at bestpractical.com
Thu Oct 18 09:42:09 EDT 2007




On Mon, Oct 08, 2007 at 08:07:55PM -0500, Andrew Sterling Hanenkamp wrote:
> Jesse and I briefly discussed this on the channel last week. I asked about
> the possibility of having different behavior on an action based upon which
> button was pressed. For example, having a Preview and Submit form on a
> comment. I have gotten this to work like this:
> 
> 
>         form_submit
>             label => _('Preview'),
>             name => 'op',
>             class => 'first',
>             onclick => {
>                 refresh_self => 1,
>                 submit => $action,
>                 args => { preview => 1 },


Now you can do this:

			submit => { action => $action,	
				    arguments => { preview => 1 } 
				    
				   to submit that as an action argument

It works from ajaxy onclick handlers and from the regular "submit" argument to
buttons.  Does that do what you mean?


More information about the jifty-devel mailing list