ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

Grouping model Grip problem

hutstone
15 Dec 2010 23:51:19 GMT
15 Dec 2010 23:51:19 GMT

Is there anybody who could help me?

It is about the new ZK utility class GroupModelArra which is used to group data in grid. My program is almost the same as the case which is demonstrated on http://www.zkoss.org/zkdemo/grid/grouping_model. Stack trace is shown as follow:


>>java.lang.ClassCastException: org.zkoss.zul.Row cannot be cast to org.zkoss.zul.Group
>> at org.zkoss.zul.Rows.getGroup(Rows.java:168)
>> at org.zkoss.zul.Rows.updateVisibleCount(Rows.java:432)
>> at org.zkoss.zul.Rows.afterInsert(Rows.java:415)
>> at org.zkoss.zul.Rows.insertBefore(Rows.java:257)
>> at org.zkoss.zul.impl.GridDataLoader.syncModel(GridDataLoader.java:301)
>> at org.zkoss.zul.Grid$3.onEvent(Grid.java:583)

hutstone
16 Dec 2010 00:20:03 GMT
16 Dec 2010 00:20:03 GMT

if I test the group component, there is an error found:


Servlet.service() for servlet zkLoader threw exception
org.zkoss.zk.ui.metainfo.DefinitionNotFoundException: Component definition not found: group in [LanguageDefinition: xul/html], [SYS file:/D:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/ParameterManagement/dataware/new_file.zul line 13 col 31]
at org.zkoss.zk.ui.metainfo.Parser.parse(Parser.java:778)

The code is like this:

<grid fixedLayout="true">
<columns sizable="true">
<column label="Brand" sort="auto" />
<column label="Processor Type" width="150px" sort="auto" />
<column label="Memory (RAM)" width="120px" sort="auto" />
<column label="Price" width="100px" sort="auto" />
<column label="Hard Drive Capacity" width="150px" sort="auto" />
</columns>
<rows>
<group label="Dell" />
<row>
<label style="padding-left:15px" value="Dell E4500 2.2GHz" />
<label value="Intel Core 2 Duo" />
<label value="2GB RAM" />
<label value="$261.00" style="color:green" />
<label value="500GB" />
</row>
</rows>
</grid>

henrichen
16 Dec 2010 00:44:37 GMT
16 Dec 2010 00:44:37 GMT

You need PE version to use Group component. You can download evaluation copy here:

http://www.zkoss.org/download/zk.dsp

Search "Free Evaluation Downloads"

hutstone
16 Dec 2010 01:25:58 GMT
16 Dec 2010 01:25:58 GMT

The second problem is done. Thanks very much. But the fist problem still exists.

hutstone
16 Dec 2010 01:30:49 GMT
16 Dec 2010 01:30:49 GMT

I guess it is caused by this code.There is an inherited method render() which has a parameter "row".

public class CognosBranchGroupRender implements RowRenderer {
public void render(Row row, java.lang.Object obj) {
}
}

hutstone
16 Dec 2010 03:03:45 GMT
16 Dec 2010 03:03:45 GMT

The problem is settled.

Thanks for your help.