I have a dataset with two book elements. Each book element in turn has two child elements called 'name' and 'author'. I am displaying book names in the combobox. When the user selects a particular book name in the combo box, he should be able to see the author for the selected book.
 
<dataset name="dcrunstatdataset">
 <books>
  <book>
      <name>book1</name>
      <author>author1</author>
  </book>
  <book>
      <name>book2</name>
      <author>author2</author>
  </book>
 </books>
</dataset>

In order to achieve this, I have to set the datapath to the book element (i.e. the parent element) corresponding to the book name selected in the combo box, on the 'onselect' event.
 <combobox id="dcrunnamecmbbox"  width="200"
            editable="false" >
            <textlistitem       
               datapath="dcrunstatdataset:/books/book"
      text="$path{'name/text()'}"
      value="$path{'name/text()'}">
         </textlistitem>
         <method event="onselect">
       var dp = "dcrunstatdataset:/books/book
                  [/name/text()='" + this.value + "']";
          Debug.write("dp: " + dp);
          recordview.setAttribute("datapath", dp);
         </method>
     </combobox>
I am unable to get the book element (i.e. the parent element) corresponding to the book name selected in the combo box.
 


Find out what India is talking about on Yahoo! Answers India.
So, whatÂ’s NEW about the NEW Yahoo! Messenger? Find out.

Attachment: samplecode.lzx
Description: 3822497678-samplecode.lzx

_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to