-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4501370
By: y0gie
Hi
I've tried to iterate thru List of items...I've browsed thru old topics of same problems (replacing $ with #..36..,#..24.. or something like that) but it doesn't work. Am i missing something ?
Thank for your help
Here is the error i get:
java.lang.NoSuchMethodException: class org.zkoss.zul.Listitem: name=forEach args=[null]
Here is my code:
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/zul" prefix="zk"%> <%@ taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="/Partner/css/style.css" type="text/css" /> <title>ZK JSP Tag Library Demo</title> </head> <body> <div id="container"> <div id="header"> <h1><s:text name="naslov" /></h1> </div> <div id="wrapper"> <div id="content">
<zk:page zscriptLanguage="java">
<!-- ZUML -->
<zk:window border="normal" >
<zk:zscript>
import si.tusek.jdbc.PartnerDAO;
import java.util.ArrayList;
import si.tusek.partner.PartnerVO;
UserVO vo = (UserVO)session.getAttribute("user");
PartnerDAO dao = new PartnerDAO();
List all = dao.getAllZul(vo.getId());
</zk:zscript>
<zk:listbox id="box" multiple="true" rows="4">
<zk:listhead>
<zk:listheader label="Title" />
<zk:listheader label="Email" />
<zk:listheader label="Phone"/>
<zk:listheader label="Something" />
<zk:listheader label="Else" />
</zk:listhead>
<zk:listitem forEach="${all}" value="${each}" >
<zk:listcell label="${each.title}"></zk:listcell>
<zk:listcell label="${each.email}"></zk:listcell>
<zk:listcell label="${each.phone}"></zk:listcell>
<zk:listcell label="${each.something}"></zk:listcell>
<zk:listcell label="${each.else}"></zk:listcell>
</zk:listitem>
</zk:listbox>
</zk:window>
</zk:page></div>
</div>
<s:include value="/secure/navigation.jsp" /> <s:include value="/secure/footer.jsp" /></div> </body> </html>
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4509555
By: zanyking
EL -Expression will be evaluated by JSP Container not ZK, and we are not implemented ZK EL in ZK JSP Tag Lib currently.
In your case, you can simply use JSTL's foreach to accomplish your work.
You can download the sample code in:
http://sourceforge.net/project/downloading.php?groupname=zk1&filename=zk-JspTags
-demo-0.9.1.zip
Asked: 2007-09-04 22:32:59 +0800
Seen: 723 times
Last updated: Jun 26 '12