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

inserting instance elements with a trigger

From: Roman Huditsch <roman.huditsch@hico.com>
Date: Thu, 5 Dec 2002 11:33:26 +0100
Message-ID: <0C79A363CB0321418927D0CB1AD0403C095AA6@hicoetsrv000006.hico.local>
To: <www-forms@w3.org>

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 Thursday, 5 December 2002 05:34:06 GMT

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