I have this in a piece of code:

<class name="countries" extends="dims_window" title="Countries"  
datapath="countryDS:/" width="550" height="360">
   <simplelayout spacing="5" />
   <view name="search">
     <simplelayout spacing="5" />
     <view>
       <simplelayout axis="x" spacing="10" />
         <text>Code</text>
         <edittext name="code" width="40" />
     </view>
     <view>
       <simplelayout axis="x" spacing="10" />
       <text>Name</text>
       <edittext name="name" width="240" />
       <button>Search
         <method event="onclick">
           <![CDATA[
           canvas.countryDS.doRequest();
           ]]>
         </method>
       </button>
     </view>
   </view>
   <grid name="country_grid" width="${parent.width}"  
datapath="response/"
         contentdatapath="countries/country" sizetoheader="false"
         bgcolor0="0xeeeeff" bgcolor1="0xffffff">

     <gridcolumn editable="false" width="25" sortable="false"  
resizable="false">#
       <text datapath="position()" />
     </gridcolumn>
     <gridcolumn editable="false" width="40">Code
       <text datapath="code/text()" />
     </gridcolumn>
     <gridcolumn editable="false" width="460">Name
       <text datapath="name/text()" />
     </gridcolumn>

   </grid>

   <view width="700" height="50" datapath="response/countries">
     <text x="10" y="15">Pages</text>
     <slider name="page_range" x="50" y="10" width="300" keystep="1"  
minvalue="1">
       <method event="oninit">
         <![CDATA[
         this.setMaxValue(parseInt(this.datapath.xpathQuery("@pages")));
         ]]>
       </method>
     </slider>
   </view>
</class>

Given that the data set contains this:

<?xml version="1.0" encoding="UTF-8"?>
<response success="true">
   <countries page_size="2" total_records="238" records="2" page="1"  
pages="119">
<country>
   <name>UNITED ARAB EMIRATES (UAE)</name>
   <code>AE</code>
   <id type="integer">225</id>
</country>
<country>
   <name>AFGHANISTAN</name>
   <code>AF</code>
   <id type="integer">1</id>
</country>
<country>
   <name>ANTIGUA AND BARBUDA</name>
   <code>AG</code>
   <id type="integer">10</id>
</country>
<country>
   <name>ANGUILLA</name>
   <code>AI</code>
   <id type="integer">8</id>
</country>
   </countries>
</response>

The dataset fetches data remotely and does NOT have request="true" in  
its definition. It only fetches data when the "Search" button is  
clicked. Now, every time I instantiate (via script) the class, I get  
the following in the debugger:

WARNING: base/basegridrow.lzx:44: call to undefined method 'xpathQuery'

And, I guess, that when it gets to the slider section, the debugger  
also shows this:

WARNING: intranet.lzx:79: call to undefined method 'xpathQuery'

Why is that? I know they are just warnings, but ideally, I'd rather  
have no warnings. Also, is what I'm doing the correct way of doing  
this? Ignore for the moment the functionality of the search form.  
However, what I want to do is show a window with the search form.  
Only upon clicking Search, will the request be executed. Also, the  
request should pass the search terms in order to filter the results.  
Lastly, I know the grid has the functionality to sort the columns.  
However, it does so on the current dataset. What I do want is that  
when the column header is clicked, the sort will be intercepted, sent  
via the dataset, along with the values in the search term, so that  
the server returns a fresh result set sorted by whatever criteria.  
Lastly, the slider should allow for pagination among the result set.  
So, when the slider is moved, it should send to the server the new  
slider value (aka page number), as well as the currently sort by and  
direction column and the search form values.

Again, any help for this poor noobie will be greatly appreciated.

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

Reply via email to