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

RE: inserting instance elements with a trigger

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

Hi,

Coincidentally, I have just been trying to achieve the same effect. I just created an empty repeat element with an appropriate XPath expression in the nodeset attribute, and refered to that, as per X-Smiles example, in my insert. It worked fine. Seems a bit of a convoluted way of going about things though.

All the best

Mark 

> -----Original Message-----
> From: Roman Huditsch [mailto:roman.huditsch@hico.com]
> Sent: 05 December 2002 10:33
> To: www-forms@w3.org
> Subject: inserting instance elements with a trigger
> 
> 
> 
> Hi,
> 
> How can I insert an instance element, which has some child 
> elements as well, with the help of a trigger? I just know the 
> examples of X-Smiles where a repeat is used. The problem is 
> that I don't want my UI to change, when I insert the new 
> instance structure. 
> I only want my ref- attributes in the UI to match the latest 
> inserted elements. 
> 
> Have in the following instance:
> 
> <xforms:instance>
> 	<topicMap xmlns="http://www.topicmaps.org/xtm/1.0/" 
> xmlns:xlink="http://www.w3.org/1999/xlink">
> 		<topic id="">
> 			<instanceOf>
> 				<topicRef xlink:href=""/>
> 			</instanceOf>
> 			<baseName>
> 				<baseNameString></baseNameString>
> 			</baseName>
> 			<occurrence>
> 				<instanceOf>
> 					<topicRef xlink:href=""/>
> 				</instanceOf>
> 				<resourceRef xlink:href=""/>
> 			</occurrence>
> 			<occurrence>
> 				<instanceOf>
> 			    		<topicRef xlink:href="#"/>
> 				</instanceOf>
> 				<resourceData></resourceData>
> 			</occurrence>
> 		</topic>
> 		<association>
> 			<instanceOf>
> 				<topicRef xlink:href=""/>
> 			</instanceOf>
> 				<member>
> 					<roleSpec>
> 						<topicRef 
> xlink:href=""/>
> 					</roleSpec>
> 					<topicRef xlink:href=""/>
> 				</member>
> 				<member>
> 					<roleSpec>
> 						<topicRef 
> xlink:href=""/>
> 					</roleSpec>
> 					<topicRef xlink:href=""/>
> 				</member>
> 		</association>
> 	</topicMap>
> </xforms:instance>
> 
> I want the topic element to be duplicated (or a new topic 
> element to be inserted) when I use a trigger.
> I thought about something like 
> 
> 	<xforms:trigger id="insertbutton">
> 		<xforms:label>Insert</xforms:label>
> 		<xforms:action ev:event="click">
> 			<xforms:insert ref="/topicMap/topic" 
> at="position()=last()" position="after"/>
> 		</xforms:action>
> 	</xforms:trigger>
>  
> But it didn't work in X-Smiles.
> Do you have any solutions, please?
> 
> wbr,
> Roman 
> 
> 
Received on Friday, 6 December 2002 07:42:57 GMT

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