在DictionaryKindListPane.xhtml中:注意不要绑定字段,要重新定义变量,绑定变量。 <ui:define name="QueryConditionPanel"> <h:form style="margin:0px;" mce_style="margin:0px;" id="theBriefQueryForm"> <table align="center" width="80%"> <tr width="60%"> <td align="right" style="font-size: 10pt;" mce_style="font-size: 10pt;" width="40%"> 字典类型: <jsfext:inputText value="#{dictionaryKindModel.kindCondition}" id="kind" tabindex="1" maxlength="64"> <jsfext:jseventlistener event="onkeydown" listener="convertEnter2Tab()" /> </jsfext:inputText> </td> <td align="right" style="font-size: 10pt;" mce_style="font-size: 10pt;" width="40%"> 字典中文含义: <jsfext:inputText value="#{dictionaryKindModel.detailCondition}" id="zdzwhy" tabindex="2" maxlength="65"> <jsfext:jseventlistener event="onkeydown" listener="convertEnter2Tab()" /> </jsfext:inputText> </td> <td align="center" style="font-size: 10pt;" mce_style="font-size: 10pt;" width="20%"> <h:commandButton value=" 查 询 " action="#{dictionaryKindModel.doBriefQuery}" tabindex="3"></h:commandButton> </td> </tr> </table> </h:form> </ui:define> DictionaryKindModel: // 查询条件变量 private String kindCondition; private String detailCondition; /** * * @author:denghuimin,yanghanming * @createTime:Jul 7, 2009 11:41:24 AM * @function:重写父类的findByQueryCondition方法 * @param otherCondition * 查询条件 * @return: */ public String findByQueryCondition(String otherCondition) { String errMessage = ""; List list = new ArrayList<QueryConVo>(); if (StringUtils.isNotBlank(this.getKindCondition())) { QueryConVo conVo = new QueryConVo(dictionaryKindDAOEx.KIND, this .getKindCondition()); list.add(conVo); } if (StringUtils.isNotBlank(this.getDetailCondition())) { QueryConVo conVo = new QueryConVo(dictionaryKindDAOEx.DETAIL, this .getDetailCondition()); list.add(conVo); } dklist = new ArrayList<DictionaryKind>(); GenarateConnection gc = (GenarateConnection) getCtx().getBean( BizGlobalConstants.X_GCONNECTION); String hql = "from DictionaryKind as ti where 1=1 and ti.scbz ='0'"; try { this.dklist = gc.findListForPage(hql, list, this .getCurrentPageNumber(), this.getPageSize()); this.rowCount = gc.findCountForPage(hql, list, this .getCurrentPageNumber(), this.getPageSize()); } catch (Exception e) { e.printStackTrace(); } return errMessage; } public String doBriefQuery() { String errMessage = ""; errMessage = findByQueryCondition(dictionaryKind.getKind()); this.fromOutcome = DictionaryKindListPane; return errMessage; }