submit method in SFSB:
@End
| @TransactionAttribute(TransactionAttributeType.REQUIRED) //REQUIRED is
default, but added for clarity
| public void submit() {
|
| Object[] myAuditListSelection = getMyAuditListSelection();
|
| TblSecurityAuditWorking tsaw =
(TblSecurityAuditWorking)myAuditListSelection[1];
|
| //determine what status to assign to each row/employee based on
answers to radio buttons...
|
| //RULES: if yes/yes/yes --> green
| // if any no(s) --> yellow
| // if none selected --> red
|
| Boolean icomsAccountApproved =
tsaw.getIcomsAccountApproved()==null?false:tsaw.getIcomsAccountApproved();
| Boolean adjustmentLimitApproved =
tsaw.getAdjustmentLimitApproved()==null?false:tsaw.getAdjustmentLimitApproved();
| Boolean securityLevelApproved =
tsaw.getSecurityLevelApproved()==null?false:tsaw.getSecurityLevelApproved();
|
| if ( icomsAccountApproved && adjustmentLimitApproved &&
securityLevelApproved ) {
| //green
|
tsaw.setAuditProgress(SecurityAuditConstants.AUDIT_COMPLETE);
| }
| else if ( !icomsAccountApproved || !adjustmentLimitApproved ||
!securityLevelApproved ) {
| //yellow
|
tsaw.setAuditProgress(SecurityAuditConstants.AUDIT_WAITING_ICOMS);
| }
| else {
| //yellow
|
tsaw.setAuditProgress(SecurityAuditConstants.AUDIT_WAITING_ICOMS);
| }
|
| emICOMS.merge(tsaw);
|
| //check to see if there are any notes for each radio button for
this employee/row
| //then update/insert accordingly
|
| //TO DO: move the hard-coding 3 for # of updateable columns in
dataTable to resource bundle
|
| // TO DO: noteAction.submit() was moved to action listener
attribute in modalPanels...
| //call submit to ensure new note is added to array
| //noteAction.submit();
|
| for (int i = 0; i < 3; i++) {
| TblSecurityAuditNote note =
getTblSecurityAuditNote(currentRowNum, i);
| if (note != null) {
| log.info("myNotes["+currentRowNum+"]["+i+"]:
noteText = " + note.getNoteText());
| emICOMS.persist(note);
| }
| }
|
| emICOMS.flush();
|
| }
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114814#4114814
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114814
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user