This content has been marked as final.
Show 1 reply
-
1. Re: modalPanel best practice data passing question
asookazian Dec 12, 2007 11:18 AM (in response to asookazian)Here's the SFSB code:
//submit method called from adminSecurityAudit.xhtml modalPanel a4j:form's public void submit(ActionEvent event) { UIComponent component = event.getComponent(); Map<String, Object> attrs = component.getAttributes(); int attrsSize = attrs.size(); Integer rowIndex = (Integer)attrs.get("rowIndex"); Integer siteId = (Integer)attrs.get("siteId"); Integer employeeNumber = (Integer)attrs.get("employeeNumber"); String modalPanelName = (String)attrs.get("modalPanelName"); log.info("*** attrsSize = " + attrsSize); log.info("rowIndex = " + rowIndex + " *** siteId = " + siteId + " *** employeeNumber = " + employeeNumber); //in the case of yes/no/yes (with user entering selection for adjLimit RB last, check to make sure if the secLevel RB is No. If it's Yes (i.e. yes/yes/yes), don't proceed. if ( !( this.getIcomsAccountApproved() == true && this.getSecurityLevelApproved() == true && this.getAdjustmentLimitApproved() == true ) ) { if ( !modalPanelName.equalsIgnoreCase("mpEmployeeSubmit") ) { // in case of yes/no/yes, prevent insertion of blank note for the 3rd RB (adjLimit) //create a new instance of TblSecurityAuditNote entity bean TblSecurityAuditNote note = new TblSecurityAuditNote(siteId, employeeNumber, colName, noteText, new Date()); //TO DO: remove hard-coding of the name-number mapping Integer colNum = convertColName(colName); Integer rowNum = rowIndex==null?0:rowIndex; //TO DO: add exception handling here in case null or empty string (throw application exception) TblSecurityAuditNote[] myNoteArray = noteList.get(rowNum); myNoteArray[colNum] = note; noteList.set(rowNum, myNoteArray); noteText = ""; } } }