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

RE: putting data in the right place

From: Mark Seaborne <MSeaborne@origoservices.com>
Date: Fri, 6 Dec 2002 15:49:01 -0000
Message-ID: <DC65AE678B89004B9CCB202E19482CC704FBA2@mail.origoservices.local>
To: "Roman Huditsch" <roman.huditsch@hico.com>, <www-forms@w3.org>


We seem to be doing pretty much the same thing today! I too have just been trying to use setvalue using if() in the ref attribute. Like you I have had no luck. Do you think it is actually legal?

That said, I also tried using setvalue with just a plain XPath expression pointing to the element I just inserted, and that didn't work either. 

In the end I just decided to call it a day. I have been up since 5:00 a.m., I had to cycle 20 km to work in the dark and rain, my bike got a puncture (well, one of the innertubes did anyway), and I forgot my lunch. However in quarter of an hour I can go home, and on Monday morning everything will seem much better again.

Have a pleasant weekend


> -----Original Message-----
> From: Roman Huditsch [mailto:roman.huditsch@hico.com]
> Sent: 06 December 2002 15:28
> To: www-forms@w3.org
> Subject: putting data in the right place
> 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/t
> m: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:49:14 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:07 UTC