Wednesday, February 17, 2016

Check if the VO Row is updated! ADF


  • Add a Transient Attribute to the View Object (e.g Row Status(Integer / BigDecimal), make sure this attribute is made Updatable - Always)
  • Define the Row Impl for the VO
  • Getter method the row-

 
    /**
     * Gets the attribute value for the calculated attribute RowStatus.
     * @return the RowStatus
     */
    public Integer getRowStatus() {
        //return (Integer) getAttributeInternal(ROWSTATUS);
        byte entityState = this.getEntity(0).getEntityState();
        return new Integer(entityState);
    }
   

Integer values:
2 - Modified
0 - New
1 - Unmodified
-1 - Initialized 


// In the backingBean, We can update this row (e.g Last Updated by) only if the RowStatus is 2 













http://docs.oracle.com/cd/B14099_19/web.1012/b14022/oracle/jbo/server/EntityImpl.html

// Example
byte entityState= eo.getEntityState();
if(entityState==EntityImpl.STATUS_MODIFIED)
// .....

No comments: