[jboss-user] [JBoss Seam] - Re: Update transactions occurring prematurely in Seam app
asookazian
do-not-reply at jboss.com
Thu Dec 20 12:23:12 EST 2007
I tried using the following and in the debugger I'm seeing that in myAuditList (3rd param in action method) that row's value for the radio button clicked 'yes' is null. If I remove the 'bypassUpdates' from a4j:support, the value shows as true. I tried this twice to make sure...
xhtml:
<h:selectOneRadio id="accountApprovedRB" value="#{myRow[1].icomsAccountApproved}">
|
| <a4j:support event="onclick"
| oncomplete="processNote(#{myAuditList.getRowIndex()}, 'accountApproved')"
| action="#{noteAction.setCurrentData(myAuditList.getRowIndex(), 'accountApproved', myAuditList)}"
| ajaxSingle="true"
| bypassUpdates="true"
| reRender="mainForm"/>
SFSB:
| @PersistenceContext(unitName="boIcomsSecurityAudit", type=PersistenceContextType.EXTENDED)
| private EntityManager emICOMS;
|
| @Begin(join=true, flushMode=FlushModeType.MANUAL) // <-- use this with SMPC
| //@Begin(join=true)
| @Factory("myAuditList")
| public void findAuditList()
| {
| Boolean hardCodeEmployeeId = Boolean.parseBoolean(SecurityAuditProperties.getPropertyObject().getProperty(SecurityAuditConstants.HARD_CODE_EMPLOYEE_ID));
| Integer employeeId;
|
| if (hardCodeEmployeeId) { //if true in props file then we're testing only...
|
| employeeId = peerAction.getEmployeeId();
|
| if (employeeId == null) {
|
| employeeId = Integer.parseInt(SecurityAuditProperties.getPropertyObject().getProperty(SecurityAuditConstants.EMPLOYEE_ID)); //using btkach id for now;
| }
| }
| else {
| log.info("in getAuditList(): user.getUserId() = " + user.getUserId() + " user.getBillingId() = " + user.getBillingId());
|
| //employeeId = getEmployeeId();
|
| employeeId = peerAction.getEmployeeId();
|
| }
| myAuditList = emICOMS.createQuery("SELECT gem, tsaw "+
| "FROM TblSecurityAuditWorking tsaw, "+
| "GlobalEmployeeMaster gem "+
| "WHERE tsaw.id.siteId = gem.id.siteId "+
| "AND tsaw.id.employeeNumber = gem.id.employeeNumber "+
| "AND tsaw.reportToId = :employeeId " +
| "ORDER BY tsaw.id.employeeNumber ASC")
| .setParameter("employeeId", employeeId)
| .getResultList();
|
| //instantiate null valued noteList
| noteAction.initialize(myAuditList);
|
| log.info("in findAuditList(): myAuditList.size() = " + myAuditList.size());
|
| noteLoadList = emICOMS.createQuery("SELECT saw.id.siteId, saw.id.employeeNumber, "+
| "("+
| "SELECT count(san) as AcctApprovedNoteCount "+
| "FROM TblSecurityAuditNote san "+
| "WHERE san.siteId = saw.id.siteId "+
| "AND san.employeeNumber = saw.id.employeeNumber "+
| "AND san.noteType = 'accountApproved' "+
| ") as AcctApprovedCount, "+
| "("+
| "SELECT count(san) as secLevelApprovedNoteCount "+
| "FROM TblSecurityAuditNote san "+
| "WHERE san.siteId = saw.id.siteId "+
| "AND san.employeeNumber = saw.id.employeeNumber "+
| "AND san.noteType = 'secLevelApproved' "+
| ") as secLevelApprovedCount, "+
| "("+
| "SELECT count(san) as adjLimitApprovedNoteCount "+
| "FROM TblSecurityAuditNote san "+
| "WHERE san.siteId = saw.id.siteId "+
| "AND san.employeeNumber = saw.id.employeeNumber "+
| "AND san.noteType = 'adjLimitApproved' "+
| ") as adjLimitApprovedCount "+
| "FROM TblSecurityAuditWorking saw")
| .getResultList();
|
|
|
| log.info("in findAuditList(): noteLoadList.size() = " + noteLoadList.size());
|
|
|
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114730#4114730
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114730
More information about the jboss-user
mailing list