在DictionaryKindListPane.xhtml中,类型建立链接: <rich:column colspan="1"> <f:facet name="header"> <h:outputLabel value="类型" /> </f:facet> <div align="center"> <h:commandLink style="font-size: 10pt; color: blue; text-decoration: none" value="#{temp.kind}" action="#{dictionaryKindModel.to}"> <f:param name="id" value="#{temp.id}"></f:param> </h:commandLink> </div> </rich:column> 进入ModifyDictionaryKindPanel: <jsfext:defaultFocusedElement value="zdzwhy" /> <h:form> <t:saveState value="#{dictionaryKindModel}" /> <fieldset align="center" style="width: 400; height: 300; border: 1px solid blue; margin: 0px; padding: 0px;"> <legend> <span style="font-size: 10pt; font-weight: bold; color: black" mce_style="font-size: 10pt; font-weight: bold; color: black">字典类型信息</span> </legend> <table width="100%" align="center" border="0"> <tr> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 类型: </td> <td> <jsfext:outputText value="#{dictionaryKindModel.dictionaryKind.kind}" id="lx" style="width:200px" maxlength="64" /> </td> </tr> <tr> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 中文含义: </td> <td> <jsfext:inputText id="zdzwhy" size="35" tabindex="1" value="#{dictionaryKindModel.dictionaryKind.detail}" required="true" cnName="字典中文含义" disabled="#{dictionaryKindModel.bolInput}" maxlength="65"> <jsfext:jseventlistener event="onkeydown" listener="convertEnter2Tab()" /> </jsfext:inputText> </td> </tr> <tr> <td align="right" style="font-size: 10pt" mce_style="font-size: 10pt"> 来源: </td> <td> <jsfext:selectOneMenuEx2 id="ly" kind="LY" tabindex="2" style="width:166px" value="#{dictionaryKindModel.dictionaryKind.source}" disabled="#{dictionaryKindModel.bolInput}" maxlength="16"> <jsfext:jseventlistener event="onkeydown" listener="convertEnter2Tab()" /> </jsfext:selectOneMenuEx2> </td> </tr> </table> <div align="center"> <h:commandButton tabindex="3" value=" 修 改 " id="modify" disabled="#{dictionaryKindModel.bolModify}" action="#{dictionaryKindModel.changeFlag}" immediate="true"> <f:param value="#{dictionaryKindModel.dictionaryKind.id}" name="id"></f:param> </h:commandButton> <h:commandButton tabindex="4" value=" 保 存 " id="save" action="#{dictionaryKindModel.update}" disabled="#{dictionaryKindModel.bolSave}" /> <h:commandButton tabindex="5" value=" 取 消 " id="cancel" action="#{dictionaryKindModel.recover}" disabled="#{dictionaryKindModel.bolCancel}"> </h:commandButton> </div> </fieldset> </h:form> DictionaryKindModel.java中方法: public DictionaryKind cloneDicKind; // 控件可操作标志 private boolean bolSave = true; private boolean bolInput = true; private boolean bolModify = false; private boolean bolCancel = true; // 错误信息 private String errorStr; // 常量 private static final String SCBZ0 = "0"; private static final String SCBZ1 = "1"; private static final String ModifyDictionaryKindPane = "ModifyDictionaryKindPane"; private static final String DictionaryKindListPane = "DictionaryKindListPane"; private static final String AddDictionaryKindPane = "AddDictionaryKindPane"; public List<DictionaryKind> dklist; /** * * @author:denghuimin,yanghanming * @createTime:Jul 7, 2009 11:37:36 AM * @function:跳转到修改字典类型页面 * @return: */ public String to() { bolSave = true; bolInput = true; bolModify = false; bolCancel = true; // 获取页面传来的字典id Map requestParams = FacesContext.getCurrentInstance() .getExternalContext().getRequestParameterMap(); String id = (String) requestParams.get("id"); // 遍历list表,在list表中找到相应的字典,并克隆相应的副本作为取消修改操作时恢复字典 for (int i = 0; dklist != null && i < dklist.size(); i++) { dictionaryKind = (DictionaryKind) dklist.get(i); if (StringUtils.equals(dictionaryKind.getId(), id)) { this.setDictionaryKind(dictionaryKind); cloneDicKind = (DictionaryKind) CommonUtil .cloneObject(dictionaryKind); break; } } return ModifyDictionaryKindPane; } /** * * @author:denghuimin,yanghanming * @createTime:Jul 7, 2009 11:35:00 AM * @function:点击修改时候,改变控件的可用性 * @return: */ public String changeFlag() { bolSave = false; bolInput = false; bolModify = true; bolCancel = false; return null; } /** * * @author:denghuimin,yanghanming * @createTime:Jul 7, 2009 11:28:00 AM * @function:更新字典类型 * @return: */ public String update() { transactionTemplate.execute(new TransactionCallbackWithoutResult() { public void doInTransactionWithoutResult( TransactionStatus transactionStatus) { bolSave = true; bolInput = true; bolModify = false; bolCancel = true; dictionaryKindDAOEx.attachDirty(dictionaryKind); } }); return null; } /** * * @author:denghuimin,yanghanming * @createTime:Jul 7, 2009 11:30:00 AM * @function:取消修改操作 * @return: */ public String recover() { DictionaryKind cloneTemp = (DictionaryKind) CommonUtil .cloneObject(cloneDicKind); this.setDictionaryKind(cloneTemp); return null; }