W3C home > Mailing lists > Public > www-forms@w3.org > December 2002

putting data in the right place

From: Roman Huditsch <roman.huditsch@hico.com>
Date: Fri, 6 Dec 2002 16:27:48 +0100
Message-ID: <0C79A363CB0321418927D0CB1AD0403C095AAA@hicoetsrv000006.hico.local>
To: <www-forms@w3.org>

Hello again,

With Mark's help I was able to create a new instance structure when hitting a trigger. 
I now tried to combine this creation with a setvalue-action but failed.


I have the following syntax:

	<xforms:repeat nodeset="/tm:topicMap/tm:topic" id="topicRepeat" startindex="0"/>
	<xforms:input ref="/tm:topicMap/tm:topic/@id">
		<xforms:hint>Eindeutiger Wert zur Identifikation des Topics</xforms:hint>
	</xforms:input>
	<xforms:trigger id="insertbutton">
		<xforms:label>Topic hinzufügen</xforms:label>
		<xforms:action ev:event="click">
			<xforms:setvalue ref="xforms:if(count(/tm:topicMap//tm:topic)=1),/tm:topicMap/tm:topic[1]/@id,/tm:topicMap/tm:topic[last()-1]/@id" value="/tm:topicMap/tm:topic[last()]/@id"/>
			<xforms:insert nodeset="/tm:topicMap/tm:topic" at="xforms:index('topicRepeat')" position="after"/>
		</xforms:action>
	</xforms:trigger>

This code "should" do the following. As soon as I hit the trigger, the current value is saved in the previous topic-id. If there is just one topic within the instance data, the value should be stored in the single topic-id. After this setvalue action a new topic-structure should be created.
The problem with the code above is that the id value is always stored at the latest topic-id attribute.
Can you help me?

wbr,
Roman
Received on Friday, 6 December 2002 10:28:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:21:54 GMT