删除字典类型

<rich:column colspan="1"> <f:facet name="header"> <h:outputLabel value="删除" /> </f:facet> <div align="center"> <t:commandLink styleClass="cbLink_table" value="删除" action="#{dictionaryKindModel.remove}" onclick="if(!confirm('确定要删除吗?')) return false;"> <f:param name="id" value="#{temp.id}"></f:param> </t:commandLink> </div> </rich:column>

 

逻辑删除字典类型:

/** * * @author:denghuimin,yanghanming * @createTime:Jul 7, 2009 11:33:12 AM * @function:逻辑删除字典类型 * @return: */ public String remove() { transactionTemplate.execute(new TransactionCallbackWithoutResult() { public void doInTransactionWithoutResult( TransactionStatus transactionStatus) { // 获取页面传来的字典类型的id,遍历list表,如果list存在相同的字典,则从list中删除 Map requestParams = FacesContext.getCurrentInstance() .getExternalContext().getRequestParameterMap(); String id = (String) requestParams.get("id"); for (int i = 0; dklist != null && i < dklist.size(); i++) { dictionaryKind = dklist.get(i); if (StringUtils.equals(dictionaryKind.getId(), id)) { dklist.remove(i); break; } } // 逻辑删除字典,设置删除标志,1代表删除,0代表不删除 dictionaryKind.setScbz(SCBZ1); dictionaryKindDAOEx.attachDirty(dictionaryKind); } }); return null; }

 

 

你可能感兴趣的:(list,String,header,null,action,facet)