Anil's Blog is Best Viewed on GOOGLE CHROME

Monday, August 2, 2010

How to make selected row Read Only in Table



In this exercise, we are making read only one column of a Table Bean on the click of a image column.


Steps:

1. Create one Boolean Transient Attribute in existing VO.



 2.  Set the SPEL syntax into the Read Only property for the attributes of table that you want to make read only. In below screenshot I have set it for one column.




3.  Create event on image column. Name of Event : update


Controller Code

import oracle.apps.fnd.framework.OARow;

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
  {
    super.processFormRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if ("update".equals(pageContext.getParameter(EVENT_PARAM)))
    {
          String rowReference = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
          if(rowReference != null)
          {
            TestVORowImpl xxvorowimpl = (TestVORowImpl)am.findRowByRef(rowReference);
            xxvorowimpl.setreadOnlyAttr(Boolean.TRUE);
          }
        
    }
  }

Cheers!!!