cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oceatoon <t.katelb...@systheo.com>
Subject Re: Repeater addRow action button to link??
Date Sat, 27 Nov 2004 18:27:21 GMT
Well this seemed like a easy solution
but I was over enthousiastic :)

I implemented my xsl
<xsl:template match="fi:action[fi:styling/@type='link']">
<div style="float:left">
<a id="{@id}" name="{@id}" title="{fi:hint}"
href="javascript:forms_submitForm(this,'{@id}')">                
<xsl:value-of select="@id"/>
<xsl:apply-templates select="." mode="styling"/> 
</a>
</div>
</xsl:template>

I end up with the right link with a call to forms_submitForm
but I don't understand why it doesn't execute the function???

Maybe you would have an idea ?
Thx 
Tibor

> Sylvain Wallez wrote:
> 
>> 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
>> 
> Thx Sylvain, That's reativity :) Thx
> Regards
> Tibor



Mime
View raw message