Re: [Xsltforms-support] stepping through recordset type data display
Brought to you by:
alain-couthures
From: Stephen C. <Ste...@ut...> - 2010-01-05 23:02:58
|
Hi Tambet, I have elaborated the test case that you sent me and it works (see below). My code is doing basically the same thing so I must have made a mistake somewhere, so I'll start again with something simple and redo everything to see where it fails. Thanks <?xml version="1.0" encoding="UTF-8"?> <!-- Created with Liquitem XML Studio - FREE Community Edition 7.0.4.795 (http://www.liquitem-technologies.com) --> <?xml-stylesheet href="forms/xsltforms/xsltforms.xsl" type="text/xsl"?> <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 id="model1"> <xf:instance id="data"> <data xmlns=""> <item id="1"> <p1>1-1</p1> <p2>1-2</p2> <p3>1-3</p3> </item> <item id="2"> <p1>2-1</p1> <p2>2-2</p2> <p3>2-3</p3> </item> <item id="3"> <p1>3-1</p1> <p2>3-2</p2> <p3>3-3</p3> </item> <item id="4"> <p1>4-1</p1> <p2>4-2</p2> <p3>4-3</p3> </item> <item id="5"> <p1>5-1</p1> <p2>5-2</p2> <p3>5-3</p3> </item> </data> </xf:instance> <xf:instance id="temp"> <data xmlns=""> <selected_item>3</selected_item> </data> </xf:instance> </xf:model> </head> <body> <xf:select1 ref="instance('temp')/selected_item"> <xf:itemset nodeset="instance('data')/item"> <xf:value ref="@id"/> <xf:label ref="@id"/> </xf:itemset> </xf:select1> <xf:group ref="instance('data')/item[@id = instance('temp')/selected_item]"> <br/> <xf:output ref="p1"> <xf:label>Property 1 = </xf:label> </xf:output> <br/> <xf:output ref="p2"> <xf:label>Property 2 = </xf:label> </xf:output> <br/> <xf:output ref="p3"> <xf:label>Property 3 = </xf:label> </xf:output> </xf:group> <br /> <div id="console" style="display:block;top:100px;" /> </body> </html> -------- Original Message -------- Subject: Re: [Xsltforms-support] stepping through recordset type data display Date: Tue, 05 Jan 2010 10:01:28 +0200 From: Tambet Matiisen <tam...@gm...> To: Stephen Cameron <Ste...@ut...> CC: xsl...@li... References: <4B4...@ut...> Stephen Cameron wrote: > Hello, > > I have a specific problem where I wish to select a record from a > xf:select1 list and then on on the basis of the selected value display a > full record below it. > > The full record will be displayed with the use of a xf:group tag, so I > am a really wanting to dynamically change the node the group references > via its 'ref 'or 'bind' attribute Something like this should work: <xforms:select1 ref="instance('temp')/selected_id"> <xforms:itemset nodeset="instance('data')/item"> <xforms:value ref="id"/> <xforms:label ref="label"/> </xforms:itemset> </xforms:select1> <xforms:group ref="instance('data')/item[id = instance('temp')/selected_id]"> <xforms:output ref="id">...</xforms:output> <xforms:output ref="label">...</xforms:output> </xforms:group> Tambet -- Regards Stephen Cameron Data Programmer Integrated Marine Observing System (IMOS) eMarine Information Infrastructure Project University of Tasmania, Private Bag 21, Hobart, TAS 7001, Australia Tel: +61 3 6226 8507 Fax: +61 3 6226 2997 Email: ste...@ut... URL: http://www.imos.org.au/eMII.html |