【发布时间】:2011-02-03 21:18:38
【问题描述】:
我想知道是否有某种方法可以将某个 webbean 获取的列表传递给 JSF 2.0 中的组件? webbean getList 应将客户端列表返回给组件。例如:
组件:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:composite="http://java.sun.com/jsf/composite">
<head>
<title>This will not be present in rendered output</title>
</head>
<body>
<composite:interface>
<composite:attribute name="list" required="true"/>
</composite:interface>
<composite:implementation>
<h:dataTable id="clients" value="#{list}" var="client">
<h:column>
<f:facet name="header">
<h:outputText value="Client"></h:outputText>
</f:facet>
<h:outputText value="#{client.username}"></h:outputText>
</h:column>
....
</h:dataTable>
</composite:implementation>
</body>
</html>
用户页面应传递返回 List 对象的 webBean 的位置。
....
<components:list-client list="webBean.getList"/>
....
你能举个例子吗?
最好的问候
【问题讨论】:
标签: jsf jsf-2 composite-component