RE: inserting instance elements with a trigger

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 UTC