XForms repeat question

Alex Meyers <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xml
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
Testing the repeat control in formsPlayer and Mozilla as the status page 
(9.3.5) indicates that it shoudl work partial
(and guess what, different behaviour again, I am getting used to this :))

In formsPlayer the trigger "Insert after" works but the positioning is 
always 1 off (the @voor and @na attributes where used to do some tracing 
of positions, they show correct values 3 and 4 etc ...)

in Mozilla neither of the insert triggers work (and of course the 
setvalue actions destroy the original data)
(the @voor and @na attributes show values 3 and 3 all the time)

Alex


---------------------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<!--This Document was edited using XFormation (Trial) by Focus Software 
Limited on donderdag 19 mei 2005 at 14:13.-->
<html xmlns="http://www.w3.org/1999/xhtml" 
xmlns:xf="http://www.w3.org/2002/xforms" 
xmlns:ev="http://www.w3.org/2001/xml-events">
	<head>
		<xf:model>
			<xf:instance xmlns="">
				<cevi voor="" na="">
					<persoon naam="Heijl" voornaam="Danny" />
					<persoon naam="Meyers" voornaam="Alex" />
					<persoon naam="Van Hauthem" voornaam="Andries" />
				</cevi>
			</xf:instance>
			<xf:submission id="SaveLocal" action="./savelocal.xml" method="put" 
replace="none" ref="/" />
			<xf:submission 
action="http://pcplatf01/Scripts/XForms/XForms.dll/ShowXML" 
method="post" id="ShowXML" mediatype="application/xml" 
encoding="iso-8859-1" includenamespaceprefixes="cevi" standalone="yes" />
		</xf:model>
	</head>
	<body>
		<xf:trigger>
			<xf:label>Insert After</xf:label>
			<xf:setvalue ev:event="DOMActivate" ref="@voor" 
value="count(//persoon)" />
			<xf:action ev:event="DOMActivate">
				<xf:insert nodeset="persoon" at="count(//persoon)" position="after" />
				<xf:setvalue ref="persoon[last()]/@naam" />
				<xf:setvalue ref="persoon[last()]/@voornaam" />
				<xf:setfocus control="naam" />
			</xf:action>
			<xf:setvalue ref="@na" value="count(//persoon)" ev:event="DOMActivate" />
			<xf:setindex repeat="repeater" index="count(//persoon)" 
ev:event="DOMActivate" />
		</xf:trigger>
		<xf:trigger>
			<xf:label>Insert Before</xf:label>
			<xf:action ev:event="DOMActivate">
				<xf:insert nodeset="persoon" at="1" position="before" />
				<xf:setvalue ref="/cevi/persoon[1]/@naam" />
				<xf:setvalue ref="/cevi/persoon[1]/@voornaam" />
				<xf:setindex repeat="repeater" index="1" />
				<xf:setfocus control="naam" />
			</xf:action>
		</xf:trigger>
		<br />
		<xf:input ref="@voor">
			<xf:label />
		</xf:input>
		<xf:input ref="@na">
			<xf:label />
		</xf:input>
		<br />
		<xf:submit submission="ShowXML">
			<xf:label>ShowXML</xf:label>
		</xf:submit>
		<xf:submit submission="SaveLocal">
			<xf:label>SaveLocal</xf:label>
		</xf:submit>
		<br />
		<xf:repeat nodeset="persoon" id="repeater">
			<xf:input ref="@naam" id="naam" />
			<xf:input ref="@voornaam" />
			<br />
		</xf:repeat>
	</body>
</html>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.