You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Peter Neu <pe...@gmx.net> on 2006/01/12 14:43:19 UTC
Problem with Event Handler
Hello,
I got some trouble using the event handlers introduced in car selector
example:
Somehow I can't get the event handler to work the form definition looks like
this:
<fd:widgets>
<fd:field id="allUsers" required="true">
<fd:label>allUsers</fd:label>
<fd:datatype base="string"/>
<fd:selection-list >
<fd:item value="1"/>
<fd:item value="2"/>
<fd:item value="3"/>
</fd:selection-list>
<fd:on-value-changed>
<fd:javascript>
var msg = this.lookupWidget("../message");
msg.value = "Selecting.";
</fd:javascript>
</fd:on-value-changed>
</fd:field>
<fd:output id="message" initial-value="Nothing new happened">
<fd:datatype base="string"/>
<fd:on-value-changed>
<fd:javascript>
java.lang.System.err.println("Message changed to ");
</fd:javascript>
</fd:on-value-changed>
</fd:output>
</fd:widgets>
</fd:form>
The template looks like this.:
<content>
<ft:form-template action="index" method="POST">
<ft:continuation-id/>
<fi:group>
<fi:styling layout="columns"/>
<fi:items>
<ft:widget id="allUsers">
<fi:styling submit-on-change="true"/>
</ft:widget>
<ft:widget id="message"/>
<ft:widget id="submitIt"/>
</fi:items>
</fi:group>
</ft:form-template>
</content>
</page>
Why is this not working? I also noticed that in my flow script I can't call
the widget values. Like this:
var wid = form.getWidget();
wid.make.value = cocoon.parameters.defaultMake;
Cheers,
Pete
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org