PDA

View Full Version : Gird count does not update Please help !!


cu_teo_Sj
12-21-2006, 11:18 AM
Please help me.
i have two files here is the xml file place under c:\Inetpub\wwwroot\test.xml

Test.xml
<myXML>

<fontSize> 12 </fontSize>
<fontSize> 13 </fontSize>
<fontSize> 14 </fontSize>
<fontSize> 15 </fontSize>

</myXML>

Here is the laszlo file

Temp.lzx
<canvas width="100%" height="100%" debug="true">
<dataset name="test" request="true" src="http://localhost/test.xml" />
<simplelayout axis="y" spacing="10"/>
<grid name="gridTest" width="20%" height="20%" contentdatapath="./fontSize" datapath="test:/myXML"/>

<button text="Get Total">
<method event="onclick">
<![CDATA[
test.doRequest();
Debug.write("Current Count is: " + gridTest.getNumItems() + "\n");
]]>
</method>
</button>
</canvas>

Step 1:
Launch Temp.lzx (Grid with data been display)
Step 2:
Open up Test.xml and remove one row
Step 3:
Go back to Temp.lzx click on button Get Total, if you noticed the grid view get update just fine but the total is not. Any thoughts?

Any suggestion please email to duenguyen@yahoo.com

senshi
12-21-2006, 11:45 AM
Add this handler for your dataset:

<handler name="ondata" reference="test" >
Debug.write( "Current Count is: " + gridTest.getNumItems() + "\n" );
</handler>


You have to wait for the data.
You try to get the total amount of rows before the new data has been received.

cu_teo_Sj
12-21-2006, 03:43 PM
Thanks for the help now it works really great. When compile it gave me a warning where element handler does not allow. Beside that everything else work very nice.

Thanks
-Due