锁定老帖子 主题:JSF+EJB3架构实际项目
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2008-03-04
In this case, if the condition is quite complicated, you might need a helper class to wrap all the condition data needed,and pass it to session bean as a parameter.
Put it very simple,for instance: 1) In Jsp(or xhtml) pages: <div class="light col input-field"> <h:inputText id="staffName" value="#{xxxBean.staffQueryCondition.staffName}" required="true"/> </div> <div class="light col input-field"> <t:inputDate id="startTime" value="#{xxxBean.staffQueryCondition.startTime}" required="true"/> </div> <div class="light col output-field"> <t:inputDate id="endTime" value="#{xxxBean.staffQueryCondition.endTime}" rquired="true"//> </div> ...... <!-- Display search result --> <div id="result" class="section"> <t:dataTable id="staffList" value="#{xxxBean.staffList}" var="staff" renderedIfEmpty="false" preserveSort="true" rowIndexVar="rowIndex" rows="#{searchAssetBean.searchResultWrapper.rowsPerPage-5}" styleClass="datatable" preserveDataModel="false" first="0" varDetailToggler="detailToggler"> <h:column> <f:facet name="header"> <h:outputText value="#{msg.no}"/> </f:facet> <h:outputText value="#{rowIndex+1}"/> </h:column> <h:column> <f:facet name="header"> <t:commandSortHeader columnName="name" arrow="true" > <h:outputText value="#{msg.external_id}"/> </t:commandSortHeader> </f:facet> <h:outputText value="#{staff.name}"/> </h:column> ...... </t:dataTable> </div> 2) JSF managed bean examples: public class xxxBean extends xxxManagedBean { static final Logger log=Logger.getLogger("xxxBean"); private StaffQueryCondition staffQueryCondition; private List<Staff> staffList; ...... public String query() { staffList=xxxxSessionBean.get(staffQueryCondition); .... return "xxxView"; } } |
|
返回顶楼 | |
发表时间:2008-03-10
这样做,也不失为省时,省力的做法。谢谢fxy1949。
|
|
返回顶楼 | |
发表时间:2008-05-28
怎么不用SEAM?
|
|
返回顶楼 | |