oceatoon wrote:
Hi everyone
I tried posting this too the user list but got no answer hope I'll be
luckier in dev :)
in our website, I tried to make a link that launches the addrow action
instead of the usual submit type button launching on my repeater,
but I can't get it to launch the action??
this is what is originaly done <input name="addroom" type="submit" id="addroom" value="Add a Room" />
and I would want <a href="javascript:document.forms[0].submit();" id="addroom">Add Room</a> but this has a complete submit action, and not just addrow submit ???
Following the event handler docs, is it possible to connect my link to the
list of event listenners or actions define for the addrow? in my case
addroom ?
Yes. Please have a look at how is implemented "submit-on-change" in forms-field-styling.xsl: you have to call "forms_submitForm(this, "addroom")".
BTW, your use case is actually a styling of type "link" for the action widget. I just added it to the CForms styling stylesheets, meaning with the updated forms-field-styling.xsl you can now write:
<fd:repeater-action id="addroom" ....> <fd:label>Add a room</fd:label> </fd:repeater-action>
and
<ft:widget id="addroom"> <fi:styling type="link"/> </ft:widget>
Enjoy, Sylvain
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
