0

ListModel in JSP

asked 2008-05-12 15:56:11 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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

By: roxcastaneda


Im trying to add items on the list using JSP but i got this error;

I used the list2.zul test by converting the syntax to JSP.

<zk:zscript>
import org.zkoss.zul.*;
import org.zkoss.zul.AbstractListModel.*;
import org.zkoss.zul.ListModelArray.*;
import org.zkoss.zul.SimpleListModel.*;

String[] d1 = new String[30];
List d2 = new LinkedList();
for(int j=0; j < d1.length; ++j) {
d1[j] = "option "+j;
d2.add(d1[j]);
}

ListModel model1 = new SimpleListModel(d1);
ListModelList model2 = new ListModelList(d2, false); </zk:zscript>

I got the ff: stack trace

Cause: class java.lang.String cannot be converted to interface org.zkoss.zul.ListModel.
java.lang.ClassCastException: class java.lang.String cannot be converted to interface org.zkoss.zul.ListModel.
at org.zkoss.lang.Classes.coerce(Classes.java:1273)
at org.zkoss.zk.xel.ExValue.coerce(ExValue.java:116)
at org.zkoss.zk.xel.ExValue.getValue(ExValue.java:111)
at org.zkoss.zk.ui.metainfo.Property.assign(Property.java:161)
at org.zkoss.zk.ui.metainfo.ComponentInfo.applyProperties(ComponentInfo.java:57
7)
at org.zkoss.zk.ui.impl.AbstractUiFactory.newComponent(AbstractUiFactory.java:9
5)

What could be wrong?

rocky

delete flag offensive retag edit
Be the first one to reply this discussion!
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: 2008-05-12 15:56:11 +0800

Seen: 194 times

Last updated: May 12 '08

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