rich:moalpanel with managed-bean property
skumarsamy Mar 3, 2009 5:20 AMHi,
I'm new to richfaces and jsf.
I have did some exploration and developed one page which shows user details, which includes another page which is UI:included this page show the user's security information
I have SecurityManger the control bean, which holds SystemUser bean as property, which in turn holds SecurityInfo bean as its property. My problem is when securityinfo insert action invoked throws null with my values, i tried many waysif i try to invoke the insert action second time the data gets inserted.
I'm posting the whole set here
Here is my manager bean class
package com.radlink.eris.systemuser.manager; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import javax.faces.event.ActionEvent; import javax.faces.model.SelectItem; import org.ajax4jsf.component.html.HtmlAjaxCommandButton; import org.richfaces.component.UIDataList; import com.radlink.eris.common.bean.BeanHelper; import com.radlink.eris.common.entity.ERISBase; import com.radlink.eris.common.entity.ERISWebBase; import com.radlink.eris.common.manager.ContactManager; import com.radlink.eris.common.master.entity.LookupDetail; import com.radlink.eris.core.exception.GenericDaoException; import com.radlink.eris.core.exception.GenericManagerException; import com.radlink.eris.core.manager.ERISApplicationManager; import com.radlink.eris.core.manager.IWebManager; import com.radlink.eris.core.resources.IMessages; import com.radlink.eris.systemuser.dao.ISecurityInfoDAO; import com.radlink.eris.systemuser.dao.ISystemUserDAO; import com.radlink.eris.systemuser.entity.SecurityInfo; import com.radlink.eris.systemuser.entity.SystemUser; public class SystemUserManager extends ERISWebBase implements IWebManager { private SystemUser systemUser; private List<SystemUser> systemUsers; private List<LookupDetail> countries; private List<LookupDetail> userTypes; private List<LookupDetail> userDepartments; private List<LookupDetail> userTitles; private List<LookupDetail> employmentTypes; private List<LookupDetail> addressTypes; private List<LookupDetail> passwdQuestionTypes; private List<SelectItem> countryOptions = new ArrayList<SelectItem>(); private List<SelectItem> userTypeOptions = new ArrayList<SelectItem>(); private List<SelectItem> userDepartmentOptions = new ArrayList<SelectItem>(); private List<SelectItem> userTitleOptions = new ArrayList<SelectItem>(); private List<SelectItem> employmentTypeOptions = new ArrayList<SelectItem>(); private List<SelectItem> addressTypeOptions = new ArrayList<SelectItem>(); private List<SelectItem> passwdQuestionTypeOptions = new ArrayList<SelectItem>(); private String[] lookupNames = { "Country", "User Type", "User Department", "Employment Type", "Title", "Password Question Type" }; ContactManager contactManager; SecurityManager securityManager; private boolean userEditable = false; private boolean userSecurityEditable = false; private UIDataList usersTable; private HtmlAjaxCommandButton userUpdateLink; private HtmlAjaxCommandButton userSecurityUpdateLink; ISystemUserDAO systemUserDao; ISecurityInfoDAO securityDao; public SystemUserManager() throws GenericManagerException { try { systemUser = new SystemUser(); systemUser.setSecurityInfo(new SecurityInfo()); systemUser.getSecurityInfo().init(); systemUserDao = BeanHelper.getSystemUserDAO(); securityDao = BeanHelper.getSecurityInfoDAO(); systemUsers = systemUserDao .getSystemUsers(ERISBase.TEST_ORGNIZATIONID); initLookups(); } catch (GenericDaoException exp) { throw new GenericManagerException(exp.getMessage(), exp .getErrorCode(), exp, exp.getParameterValues()); } catch (Exception exp) { throw new GenericManagerException(exp.getMessage(), IMessages.ERROR_SYSTEM_MANAGER_UNKNOWN, exp); } } @SuppressWarnings("unchecked") public void initLookups() throws GenericManagerException { Map lookupDetailMap = ERISApplicationManager .GetApplicationLookupOptions(lookupNames); if (lookupDetailMap != null) { Map<String, List<LookupDetail>> lookupDetailsMap = (Map<String, List<LookupDetail>>) lookupDetailMap .get(ERISApplicationManager.MAP_LOOKUP); Map<String, List<SelectItem>> lookupDetailsOptionMap = (Map<String, List<SelectItem>>) lookupDetailMap .get(ERISApplicationManager.MAP_LOOKUP_OPTIONS); for (String lookupName : lookupNames) { logger.info("Lookup Map: " + lookupDetailsMap.size() + ":" + lookupDetailsOptionMap.size()); logger.info("SystemUser UI Lookup: " + lookupName); if ("Country".equals(lookupName)) { countries = (List<LookupDetail>) lookupDetailsMap .get(lookupName); countryOptions = lookupDetailsOptionMap.get(lookupName + "Options"); logger.info("SystemUser UI Lookup: " + lookupName + ":" + countries.size()); } else if ("User Type".equals(lookupName)) { userTypes = (List<LookupDetail>) lookupDetailsMap .get(lookupName); userTypeOptions = lookupDetailsOptionMap.get(lookupName + "Options"); logger.info("SystemUser UI Lookup: " + lookupName + ":" + userTypes.size()); } else if ("User Department".equals(lookupName)) { userDepartments = (List<LookupDetail>) lookupDetailsMap .get(lookupName); userDepartmentOptions = lookupDetailsOptionMap .get(lookupName + "Options"); logger.info("SystemUser UI Lookup: " + lookupName + ":" + userDepartments.size()); } else if ("Employment Type".equals(lookupName)) { employmentTypes = (List<LookupDetail>) lookupDetailsMap .get(lookupName); employmentTypeOptions = lookupDetailsOptionMap .get(lookupName + "Options"); logger.info("SystemUser UI Lookup: " + lookupName + ":" + employmentTypes.size()); } else if ("Title".equals(lookupName)) { userTitles = (List<LookupDetail>) lookupDetailsMap .get(lookupName); userTitleOptions = lookupDetailsOptionMap.get(lookupName + "Options"); logger.info("SystemUser UI Lookup: " + lookupName + ":" + userTitles.size()); } else if ("Password Question Type".equals(lookupName)) { passwdQuestionTypes = (List<LookupDetail>) lookupDetailsMap .get(lookupName); passwdQuestionTypeOptions = lookupDetailsOptionMap .get(lookupName + "Options"); } } } } public void cancelAction(ActionEvent e) throws GenericManagerException { logger.info("Cancelling Edit"); this.CURRENT_ACTION = CANCEL_ACTION; this.clearFields(); try { systemUsers = systemUserDao .getSystemUsers(ERISBase.TEST_ORGNIZATIONID);// TODO } catch (GenericDaoException exp) { throw new GenericManagerException(exp.getMessage(), exp .getErrorCode(), exp, exp.getParameterValues()); } catch (Exception exp) { throw new GenericManagerException(exp.getMessage(), IMessages.ERROR_SYSTEM_MANAGER_UNKNOWN, exp); } } public void clearFields() { logger.info("Cancelling Edit"); systemUser.reset(); setUserEditable(false); userUpdateLink.setRendered(false); } public Object collectFormData() throws GenericManagerException { SystemUser sysUsr = new SystemUser(); if (UPDATE_ACTION.equals(CURRENT_ACTION)) { sysUsr.setOrganizationId(systemUser.getOrganizationId()); sysUsr.setUserId(systemUser.getUserId()); sysUsr.setCreatedBy(systemUser.getCreatedBy()); sysUsr.setCreatedDate(systemUser.getCreatedDate()); } sysUsr.setUserType(systemUser.getUserType()); sysUsr.setDepartmentId(systemUser.getDepartmentId()); sysUsr.setTitle(systemUser.getTitle()); sysUsr.setFirstName(systemUser.getFirstName()); sysUsr.setLastName(systemUser.getLastName()); sysUsr.setNric(systemUser.getNric()); sysUsr.setDesignation(systemUser.getDesignation()); sysUsr.setDateOfBirth(systemUser.getDateOfBirth()); sysUsr.setGender(systemUser.getGender()); sysUsr.setMarkDeleted(systemUser.isDeleted() ? 1 : 0); return sysUsr; } public void deleteAction(ActionEvent e) throws GenericManagerException { try { logger.info("Deleting"); this.CURRENT_ACTION = DELETE_ACTION; systemUserDao.deleteSystemUser(systemUser); } catch (GenericDaoException exp) { throw new GenericManagerException(exp.getMessage(), exp .getErrorCode(), exp, exp.getParameterValues()); } catch (Exception exp) { throw new GenericManagerException(exp.getMessage(), IMessages.ERROR_SYSTEM_MANAGER_UNKNOWN, exp); } } public void editAction(ActionEvent e) throws GenericManagerException { logger.info("Editing"); this.CURRENT_ACTION = EDIT_ACTION; setRowDataToForm(); setUserEditable(true); userUpdateLink.setRendered(true); } public void editSecurityAction(ActionEvent e) throws GenericManagerException { logger.info("Security Editing: " + systemUser.getSecurityInfo()); } public void insertAction(ActionEvent e) throws GenericManagerException { try { logger.info("Inserting"); CURRENT_ACTION = INSERT_ACTION; SystemUser sysUsr = (SystemUser) collectFormData(); sysUsr.setOrganizationId(ERISBase.TEST_ORGNIZATIONID);// TODO sysUsr.setCreatedBy(ERISBase.TEST_USERID); // TODO sysUsr.setCreatedDate(new Date(System.currentTimeMillis())); sysUsr.setLastUpdatedBy(ERISBase.TEST_USERID); // TODO sysUsr.setLastUpdatedDate(new Date(System.currentTimeMillis())); logger.info("Inserting " + sysUsr); int userId = systemUserDao.insertSystemUser(sysUsr); sysUsr.setUserId(userId); clearFields(); systemUsers = systemUserDao .getSystemUsers(ERISBase.TEST_ORGNIZATIONID);// TODO } catch (GenericDaoException exp) { throw new GenericManagerException(exp.getMessage(), exp .getErrorCode(), exp, exp.getParameterValues()); } catch (Exception exp) { throw new GenericManagerException(exp.getMessage(), IMessages.ERROR_SYSTEM_MANAGER_UNKNOWN, exp); } } public void refreshAction(ActionEvent e) throws GenericManagerException { } public void setRowDataToForm() throws GenericManagerException { logger.info("Setting Form fields"); systemUser = (SystemUser) usersTable.getRowData(); if (systemUser != null) { try { SecurityInfo secInfo = securityDao.getUserSecurityInfo( systemUser.getOrganizationId(), systemUser.getUserId(), systemUser.getObjectType()); if (secInfo != null) { systemUser.setSecurityInfo(secInfo); setUserSecurityEditable(true); userSecurityUpdateLink.setRendered(true); } else { systemUser.setSecurityInfo(new SecurityInfo()); systemUser.getSecurityInfo().init(); setUserSecurityEditable(false); userSecurityUpdateLink.setRendered(false); } } catch (GenericDaoException exp) { throw new GenericManagerException(exp.getMessage(), exp .getErrorCode(), exp, exp.getParameterValues()); } catch (Exception exp) { throw new GenericManagerException(exp.getMessage(), IMessages.ERROR_SYSTEM_MANAGER_UNKNOWN, exp); } } } public void updateAction(ActionEvent e) throws GenericManagerException { try { logger.info("Updating"); CURRENT_ACTION = UPDATE_ACTION; SystemUser usr = (SystemUser) collectFormData(); usr.setLastUpdatedBy(ERISBase.TEST_USERID); usr.setLastUpdatedDate(new Date(System.currentTimeMillis())); logger.info(usr); systemUserDao.updateSystemUser(usr); this.userUpdateLink.setRendered(false); systemUsers = systemUserDao.getSystemUsers(usr.getOrganizationId()); } catch (GenericDaoException exp) { throw new GenericManagerException(exp.getMessage(), exp .getErrorCode(), exp, exp.getParameterValues()); } catch (Exception exp) { throw new GenericManagerException(exp.getMessage(), IMessages.ERROR_SYSTEM_MANAGER_UNKNOWN, exp); } } public SystemUser getSystemUser() { return systemUser; } public void setSystemUser(SystemUser systemUser) { this.systemUser = systemUser; } public List<SystemUser> getSystemUsers() { return systemUsers; } public void setSystemUsers(List<SystemUser> systemUsers) { this.systemUsers = systemUsers; } public boolean isUserEditable() { return userEditable; } public void setUserEditable(boolean userEditable) { this.userEditable = userEditable; } public boolean isUserSecurityEditable() { return userSecurityEditable; } public void setUserSecurityEditable(boolean userSecurityEditable) { this.userSecurityEditable = userSecurityEditable; } public UIDataList getUsersTable() { return usersTable; } public void setUsersTable(UIDataList usersTable) { this.usersTable = usersTable; } public HtmlAjaxCommandButton getUserUpdateLink() { return userUpdateLink; } public void setUserUpdateLink(HtmlAjaxCommandButton userUpdateLink) { this.userUpdateLink = userUpdateLink; } public HtmlAjaxCommandButton getUserSecurityUpdateLink() { return userSecurityUpdateLink; } public void setUserSecurityUpdateLink( HtmlAjaxCommandButton userSecurityUpdateLink) { this.userSecurityUpdateLink = userSecurityUpdateLink; } public List<LookupDetail> getCountries() { return countries; } public void setCountries(List<LookupDetail> countries) { this.countries = countries; } public List<LookupDetail> getUserTypes() { return userTypes; } public void setUserTypes(List<LookupDetail> userTypes) { this.userTypes = userTypes; } public List<LookupDetail> getUserDepartments() { return userDepartments; } public void setUserDepartments(List<LookupDetail> userDepartments) { this.userDepartments = userDepartments; } public List<LookupDetail> getEmploymentTypes() { return employmentTypes; } public void setEmploymentTypes(List<LookupDetail> employmentTypes) { this.employmentTypes = employmentTypes; } public List<LookupDetail> getAddressTypes() { return addressTypes; } public void setAddressTypes(List<LookupDetail> addressTypes) { this.addressTypes = addressTypes; } public List<SelectItem> getCountryOptions() { return countryOptions; } public void setCountryOptions(List<SelectItem> countryOptions) { this.countryOptions = countryOptions; } public List<SelectItem> getUserTypeOptions() { return userTypeOptions; } public void setUserTypeOptions(List<SelectItem> userTypeOptions) { this.userTypeOptions = userTypeOptions; } public List<SelectItem> getUserDepartmentOptions() { return userDepartmentOptions; } public void setUserDepartmentOptions(List<SelectItem> userDepartmentOptions) { this.userDepartmentOptions = userDepartmentOptions; } public List<SelectItem> getEmploymentTypeOptions() { return employmentTypeOptions; } public void setEmploymentTypeOptions(List<SelectItem> employmentTypeOptions) { this.employmentTypeOptions = employmentTypeOptions; } public List<SelectItem> getAddressTypeOptions() { return addressTypeOptions; } public void setAddressTypeOptions(List<SelectItem> addressTypeOptions) { this.addressTypeOptions = addressTypeOptions; } public List<LookupDetail> getUserTitles() { return userTitles; } public void setUserTitles(List<LookupDetail> userTitles) { this.userTitles = userTitles; } public List<SelectItem> getUserTitleOptions() { return userTitleOptions; } public void setUserTitleOptions(List<SelectItem> userTitleOptions) { this.userTitleOptions = userTitleOptions; } public List<LookupDetail> getPasswdQuestionTypes() { return passwdQuestionTypes; } public void setPasswdQuestionTypes(List<LookupDetail> passwdQuestionTypes) { this.passwdQuestionTypes = passwdQuestionTypes; } public List<SelectItem> getPasswdQuestionTypeOptions() { return passwdQuestionTypeOptions; } public void setPasswdQuestionTypeOptions( List<SelectItem> passwdQuestionTypeOptions) { this.passwdQuestionTypeOptions = passwdQuestionTypeOptions; } public void securityInfoAction(ActionEvent e) throws GenericManagerException { } public void insertSecurityAction(ActionEvent e) throws GenericManagerException { try { logger.info("Inserting Security Info"); CURRENT_ACTION = INSERT_DETAIL_ACTION; SecurityInfo secInfo = (SecurityInfo) collectSecurityFormData(); secInfo.setCreatedBy(ERISBase.TEST_USERID); // TODO secInfo.setCreatedDate(new Date(System.currentTimeMillis())); secInfo.setLastUpdatedBy(ERISBase.TEST_USERID); // TODO secInfo.setLastUpdatedDate(new Date(System.currentTimeMillis())); logger.info("Inserting " + secInfo); int userSecId = securityDao.insertUserSecurityInfo(secInfo); secInfo.setSecurityInfoId(userSecId); } catch (GenericDaoException exp) { throw new GenericManagerException(exp.getMessage(), exp .getErrorCode(), exp, exp.getParameterValues()); } catch (Exception exp) { throw new GenericManagerException(exp.getMessage(), IMessages.ERROR_SYSTEM_MANAGER_UNKNOWN, exp); } } public void updateSecurityAction(ActionEvent e) throws GenericManagerException { } public void cancelSecurityAction(ActionEvent e) throws GenericManagerException { } public Object collectSecurityFormData() throws GenericManagerException { SecurityInfo secInfo = new SecurityInfo(); if (UPDATE_DETAIL_ACTION.equals(CURRENT_ACTION)) { secInfo.setSecurityInfoId(systemUser.getSecurityInfo() .getSecurityInfoId()); secInfo.setCreatedBy(systemUser.getSecurityInfo().getCreatedBy()); secInfo.setCreatedDate(systemUser.getSecurityInfo() .getCreatedDate()); } secInfo.setOrganizationId(systemUser.getOrganizationId()); secInfo.setMasterId(systemUser.getUserId()); secInfo.setMasterType(systemUser.getObjectType()); secInfo.setLoginTries(systemUser.getSecurityInfo().getLoginTries()); secInfo.setPassword(systemUser.getSecurityInfo().getPassword()); secInfo.setPasswordQuestionType(systemUser.getSecurityInfo().getPasswordQuestionType()); secInfo.setPasswordQuestion(systemUser.getSecurityInfo().getPasswordQuestion()); secInfo.setPasswordAnswer(systemUser.getSecurityInfo().getPasswordAnswer()); secInfo.setPasswordExpiry(systemUser.getSecurityInfo().getPasswordExpiry()); secInfo.setPasswordExpiryByDays(systemUser.getSecurityInfo().getPasswordExpiryByDays()); secInfo.setUserName(systemUser.getSecurityInfo().getUserName()); secInfo.setLastlogin(systemUser.getSecurityInfo().getLastlogin()); return secInfo; } }
Here is my systemuser.xhtml which holds the modalpanel and the action buttons
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <f:view> <h:panelGrid columns="2" style="valign:top;"> <rich:panel id="usrListPnl" style="width:250px;height:400px;" header="System Users"> <rich:dataList id="UIDataTableUsers" var="user" value="#{systemUserManager.systemUsers}" binding="#{systemUserManager.usersTable}" rows="10"> <a4j:commandLink actionListener="#{systemUserManager.editAction}" value="#{user.firstName}, #{user.lastName}" reRender="usrAdminPnl" /> </rich:dataList> </rich:panel> <rich:panel id="usrAdminPnl" style="width:400px;"> <h:panelGrid columns="2"> <h:outputText value="User Type: " /> <rich:inplaceSelect id="userTypeList" value="#{systemUserManager.systemUser.userType}"> <f:selectItems value="#{systemUserManager.userTypeOptions}" /> </rich:inplaceSelect> <h:outputText value="User Department: " /> <rich:inplaceSelect id="userDepartmentList" value="#{systemUserManager.systemUser.departmentId}"> <f:selectItems value="#{systemUserManager.userDepartmentOptions}" /> </rich:inplaceSelect> <h:outputText value="Salutation: " /> <rich:inplaceSelect id="userTitleList" value="#{systemUserManager.systemUser.title}"> <f:selectItems value="#{systemUserManager.userTitleOptions}" /> </rich:inplaceSelect> <h:outputText value="First Name: " /> <h:inputText value="#{systemUserManager.systemUser.firstName}" styleClass="textname" /> <h:outputText value="Last Name: " /> <h:inputText value="#{systemUserManager.systemUser.lastName}" styleClass="textname" /> <h:outputText value="NRIC / FIN: " /> <h:inputText value="#{systemUserManager.systemUser.nric}" styleClass="textcode" /> <h:outputText value="Designation: " /> <h:inputText value="#{systemUserManager.systemUser.designation}" styleClass="textname" /> <h:outputText value="Date of Birth: " /> <rich:calendar value="#{systemUserManager.systemUser.dateOfBirth}" style="textdate" /> <h:outputText value="Gender:" /> <h:selectOneRadio value="#{systemUserManager.systemUser.gender}" /> <rich:spacer /> <h:panelGrid columns="5"> <a4j:commandButton actionListener="#{systemUserManager.insertAction}" value="Insert" rendered="#{not systemUserManager.userEditable}" reRender="usrListPnl" /> <a4j:commandButton actionListener="#{systemUserManager.updateAction}" value="Update" binding="#{systemUserManager.userUpdateLink}" rendered="false" reRender="usrAdminPnl,usrListPnl" /> <a4j:commandButton actionListener="#{systemUserManager.cancelAction}" value="Cancel" rendered="#{systemUserManager.userEditable}" reRender="usrAdminPnl,usrListPnl" /> <a4j:commandButton id="securityLink" value="Security Info" actionListener="#{systemUserManager.editSecurityAction}" rendered="#{systemUserManager.userEditable}"> <rich:componentControl for="securityModalPnl" attachTo="securityLink" operation="show" event="onclick" /> </a4j:commandButton> </h:panelGrid> </h:panelGrid> <rich:modalPanel id="securityModalPnl" minHeight="330" minWidth="400" height="330" width="400"> <f:facet name="header"> <h:panelGroup> <h:outputText value="#{systemUserManager.systemUser.firstName}, #{systemUserManager.systemUser.lastName} Security Info"></h:outputText> </h:panelGroup> </f:facet> <f:facet name="controls"> <h:panelGroup> <h:graphicImage value="/images/modal/close.png" styleClass="hidelink" id="securityHidelink" /> <rich:componentControl for="securityModalPnl" attachTo="securityHidelink" operation="hide" event="onclick" /> </h:panelGroup> </f:facet> <rich:panel> <ui:include src="/risview/administration/employee/securityinfo.xhtml" /> </rich:panel> </rich:modalPanel> </rich:panel> </h:panelGrid> </f:view> </ui:composition>
Here is my included securityinfo.xhtml, which has the form to collect information and do the insert update operation
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <h:panelGrid columns="2"> <h:outputText value="User Name: " /> <h:inputText value="#{systemUserManager.systemUser.securityInfo.userName}" styleClass="textname" /> <h:outputText value="Password: " /> <h:inputText value="#{systemUserManager.systemUser.securityInfo.password}" styleClass="textcode" /> <h:outputText value="Password Type: " /> <rich:inplaceSelect id="questionTypeList" value="#{systemUserManager.systemUser.securityInfo.passwordQuestionType}"> <f:selectItems value="#{systemUserManager.passwdQuestionTypeOptions}" /> </rich:inplaceSelect> <h:outputText value="Security Question: " /> <h:inputText value="#{systemUserManager.systemUser.securityInfo.passwordQuestion}" styleClass="textname" /> <h:outputText value="Security Answer: " /> <h:inputText value="#{systemUserManager.systemUser.securityInfo.passwordAnswer}" styleClass="textname" /> <h:outputText style="nowrap;" value="Is Password Expire? " /> <h:inputText value="#{systemUserManager.systemUser.securityInfo.passwordExpiry}" styleClass="textint" /> <h:outputText value="Expire by Days: " /> <h:inputText value="#{systemUserManager.systemUser.securityInfo.passwordExpiryByDays}" styleClass="textint" /> <h:outputText value="Login Tries: " /> <h:inputText value="#{systemUserManager.systemUser.securityInfo.loginTries}" styleClass="textint" /> <h:outputText value="Last Logged: " /> <rich:calendar readonly="true" value="#{systemUserManager.systemUser.securityInfo.lastlogin}" style="textdate" /> <rich:spacer /> <h:panelGrid columns="3"> <a4j:commandButton actionListener="#{systemUserManager.insertSecurityAction}" value="Insert" rendered="#{not systemUserManager.userSecurityEditable}" oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('securityModalPnl')}.hide();" /> <a4j:commandButton actionListener="#{systemUserManager.updateSecurityAction}" value="Update" binding="#{systemUserManager.userSecurityUpdateLink}" rendered="false" reRender="usrAdminPnl,usrListPnl" oncomplete="if (#{facesContext.maximumSeverity==null}) #{rich:component('securityModalPnl')}.hide();" /> <a4j:commandButton actionListener="#{systemUserManager.cancelSecurityAction}" value="Cancel" rendered="#{systemUserManager.userSecurityEditable}" reRender="usrAdminPnl,usrListPnl" /> </h:panelGrid> </h:panelGrid> </ui:composition>