0

GRID Sortable column problem with JSP

asked 2007-01-05 15:24:23 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4088193

By: roxcastaneda


The code snippet below i converted from grid.zul to grid.jsp which is part of the test folder for zkdemo.

My problem is that the grid.zul seems to display and execute sorting but the grid.jsp does'nt display any changes to the column intended to sort in this case the first column (Order).

Any help will be appreciated thnx.

-rocky


/*********** CODE SNIP STARTS HERE *************/ <html xmlns:zk="http://www.zkoss.org/2005/zk"
xmlns:x="http://www.zkoss.org/2005/zul">

<zk:zscript>
class Comp implements Comparator {
private boolean _asc;
public Comp(boolean asc) {
_asc = asc;
}
public int compare(Object o1, Object o2) {
String s1 = o1.getChildren().get(0).getValue(),
s2 = o2.getChildren().get(0).getValue();
int v = s1.compareTo(s2);
return _asc ? v: -v;
}
}
Comp asc = new Comp(true);
Comp dsc = new Comp(false);
</zk:zscript>

<x:grid id="grid" width="500px" height="100px">
<x:columns sizable="true">
<x:column id="col" label="Order" sortAscending="${asc}"
sortDescending="${dsc}"/>
<x:column label="Head 1"/>
<x:column label="Head 2" align="center"/>
<x:column label="Head 3" align="right"/>
</x:columns>
<x:rows>
<x:row>
Orange
<x:listbox mold="select">
<x:listitem label="AB"/>
<x:listitem label="CD"/>
</x:listbox>
<x:datebox/>
<x:textbox rows="3"/>
</x:row>
<x:row>
Apple
<x:label value="A11"/>
<x:label value="A12"/>
<x:label value="A13"/>
</x:row>
<x:row>
Lemon
<x:checkbox checked="true" label="Option 1"/>
<x:checkbox label="Option 2"/>
<x:radiogroup>
<x:radio label="Apple"/>
<x:radio label="Orange" checked="true"/>
<x:radio label="Lemon"/>
</x:radiogroup>
</x:row>
<x:row>
Tomato
<x:checkbox checked="true" label="Option 1"/>
<x:checkbox label="Option 2"/>
<x:radiogroup orient="vertical">
<x:radio label="Apple"/>
<x:radio label="Orange" checked="true"/>
<x:radio label="Lemon"/>
</x:radiogroup>
</x:row>
</x:rows>
</x:grid>

/*********** CODE SNIP ENDS HERE *************/

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2007-01-08 01:24:28 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4091061

By: henrichen

Please post to bug list along with your testing codes. Thanks.

/henri

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2007-01-05 15:24:23 +0800

Seen: 225 times

Last updated: Jan 08 '07

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More