0

PropertyNotFoundException

asked 2010-04-04 21:24:32 +0800

dorr gravatar image dorr
126 4

updated 2010-04-05 04:25:48 +0800

I am brand new to ZK and am getting the following error when accessing my .zul page:

org.zkoss.zk.ui.metainfo.PropertyNotFoundException: Method setRows not found for class com.state.controller.StateListController

This is my .zul page:
<?page title="State List" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="State List" border="normal">
<vbox>
<listbox id="stateList" width="800px" rows="5" use="com.state.controller.StateListController">
<listhead>
<listheader label="State Id" sort="auto" />
<listheader label="State Code" sort="auto" />
<listheader label="State Name" sort="auto" />
</listhead>
</listbox>
</vbox>
</window>
</zk>

What am I doing wrong?

Thanks.

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2010-04-05 22:25:01 +0800

tmillsclare gravatar image tmillsclare
799 2 5 30

Hey Dorr,

Are you wanting to use MVC pattern? If so then instead of setting the "use" attribute set the "apply" attribute to your controller.

The use attributed is used when you want to extend the functionality of a control :). Please take a look here for more information on the use attribute.

For more MVC information please take a look here.

link publish delete flag offensive edit

answered 2010-04-08 19:32:07 +0800

dorr gravatar image dorr
126 4

Thanks. I've got the list displaying, but no data. Below is my .zul and my controller class. It's not going into my controller class.

<?xml version="1.0" encoding="UTF-8"?>
<?page title="State List" contentType="text/html;charset=UTF-8"?>
<zk>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<window id="win" title="State List" width="640px" border="normal" apply="${stateListController}">
<listbox id="list" rows="5">
<listhead>
<listheader label="State Id" sort="auto" />
<listheader label="State Code" sort="auto" />
<listheader label="State Name" sort="auto" />
</listhead>
</listbox>
</window>
</zk>


public class StateListController extends GenericForwardComposer implements ListitemRenderer
{
/**
*
*/
private static final long serialVersionUID = -9063550952204076306L;
/**
*
*/

//private Listbox stateList ;
private IStateMgr stateMgr ;

protected ListModelList listModelList;
protected Listbox list;


public void doAfterCompose(Component comp) throws Exception
{
super.doAfterCompose(comp);

listModelList = new ListModelList();

List<State> states = stateMgr.getAllStates() ;

listModelList.addAll(states);
list.setModel(listModelList);

list.setItemRenderer(this);
}


public void render(Listitem listItem, Object data) throws Exception
{
State state = (State) data;

new Listcell(state.getStateId()+"").setParent(listItem);
new Listcell(state.getStateCde()).setParent(listItem);
new Listcell(state.getStateNameTxt()).setParent(listItem);
}

link publish delete flag offensive edit

answered 2010-04-08 19:34:27 +0800

dorr gravatar image dorr
126 4

Nevermind, I got it going. Thanks for your help.

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: 2010-04-04 21:24:32 +0800

Seen: 252 times

Last updated: Apr 08 '10

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