PDA

View Full Version : Static List Height??


jakeh
09-01-2004, 05:33 PM
I have dynamically generated lists. How can i set the list height so that it stays the same no matter how many items are loaded into it?

shownitems=x stays steady at that height unless there are fewer than x items. i want it to stay the larger size even if there are <x items.

Thanks.

Jake

antun
09-02-2004, 08:57 AM
How are you declaring the list? I did this:

<canvas>
<dataset name="mydata" src="http:numbers.xml" request="false" />

<simplelayout axis="y" spacing="10" />

<button>Get List Items
<method event="onclick">
mydata.doRequest();
</method>
</button>
<list id="mylist" shownitems="6" dataoption="lazy">
<textlistitem datapath="mydata:/numbers/option/@name"/>
</list>

<text text="${mylist.value}"/>
<simplelayout spacing="4" inset="10"/>
<constantlayout value="10" axis="x"/>
</canvas>

... and it worked fine.

-Antun

PS Here's the data I used:

<numbers>
<option name="first"/>
<option name="second"/>
<option name="third"/>
<option name="fourth"/>
<option name="fifth"/>
<option name="sixth"/>
<option name="seventh"/>
<option name="eigth"/>
<option name="ninth"/>
<option name="tenth"/>
</numbers>

jakeh
09-02-2004, 10:15 AM
I was missing dataoption="lazy" declaration.

Thanks Antun.


Jake

antun
09-02-2004, 10:19 AM
That turns lazy replication on - you almost always want to use lazy replication, as it improves performance significantly.

-Antun

jakeh
09-02-2004, 10:21 AM
When I use this option however... it ruins my dataselection manager in the list.


code is like this:

<list shownitems="5" width="200" dataoption="lazy">
<dataselectionmanager id="myselection" />
<textlistitem>
<datapath xpath="mydata:/myxml/mynode/text()" pooling="true" />

<method event="onclick">
myselection.select(this)

</method>
</textlistitem>
</list>

jakeh
09-02-2004, 01:11 PM
Seems to work if i use <text> instead of <textlistitem> is there any reason for this or is it a bug?

Thanks.

Jake