cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist>
Subject Re: [forms+flow] repeater widget onClick property
Date Tue, 16 Mar 2004 21:42:10 GMT

On Mar 16, 2004, at 1:38 AM, Vasyl Stashuk wrote:

> Mark Lundquist wrote:
>> I'm using Cocoon 2.1.5_dev w/ the v2 forms+flow API...
>> I've got an <fd:action> as a child of a repeater.  This is supposed 
>> to be a "Delete" button that calls removeRow() on the repeater for 
>> its row, but I can't figure out how to know, within the fd:action's 
>> onClick handler, the index of the row whose delete button submitted 
>> the form.
> <snip...>

> I have the same problem. The best solution i found so far is to refer 
> by form's submit widget, i.e.:
>    var selected = 
> form.getWidget().getSubmitWidget().getParent().getWidget("id").value;

Thanks... getWidget("id") didn't work for me — it returned null, as did 
getWidget("rowID") which I saw on some Wiki page that Joerg referenced, 
so maybe that's out of date w.r.t. the version of Cocoon I'm using.

getID() per Chris Oliver's suggestion worked.

> By the way, how do you install repeater's fd:action onClick handler?

 From flowscript, you assign to the 'onClick' property of the 
<fd:action> widget.  For instance, if you have a row object in a 
repeater containing a <fd:action> named someButton as a child, you can 

	row.someButton.onClick = function () { ...whatever };

I believe you need to be using the "v2" forms+flow integration for this 
to work.

~ Mark

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message