Menu

#631 A way to make the listbox change its model less "drastic"

closed
nobody
None
5
2007-11-16
2007-11-13
Jumper Chen
No

For example,
<window title="Live Data Demo" border="normal">
<zscript>
List data = new ArrayList();
for(int j=0; j &lt; 30; ++j) {
data.add("option "+j);
}
ListModel strset = new ListModelList(data);
</zscript>
<listbox id="list" width="200px" height="100px"
model="&#36;{strset}">
<listhead>
<listheader label="Load on Demend" sort="auto" />
</listhead>
</listbox>
<button label="change">
<attribute name="onClick">
ListModelList model = (ListModelList) list.getModel();
if(model!=null){
model.clear();
}
model = new ListModelList(data);
list.setModel(model);
</attribute>
</button>
</window>

When you click the "change" button, the table of listbox always changes very drastic.

Discussion

  • Jumper Chen

    Jumper Chen - 2007-11-16

    Logged In: YES
    user_id=1684431
    Originator: YES

    Ready since 11/16.

     
  • Jumper Chen

    Jumper Chen - 2007-11-16
    • status: open --> closed
     

Log in to post a comment.