Thursday, January 10, 2019

Making the Table rows Read Only in OAF Page

I have seen a lot of discussion on Oracle forums, where the user want to populate the data in read only mode but only specific rows.

Step -1: Create a transient attribute in the View Object attached to the Table of type Boolean.

Step -2: Create a SPEL.

Step -3: Attach this SPEL to the Read Only Property for the entire columns.

Step -4: Set the property at runtime for this Transient Attribute as TRUE or FALSE.


Write the below code in AM. This method is used to set the Read-only property to TRUE for each rows in the table.


------------- AM Code -----------------

    public void SetReadOnlyTrue() {

    OAViewObject var_vo = (OAViewObject)getXxVO1();

    if (var_vo!= null) {

    var_vo.executeQuery();

    int rowCountValue = var_vo.getRowCount();

    Row[] allRows = var_vo.getFilteredRows("XxAttribute","True");  /* Attribute in VO which specifies that the row is read only. */

    for ( int x= 0; x < allRows.length; x++ ){

    XxVORowImpl rowi = (XxVORowImpl)allRows[x];

    if(rowi!=null){

    rowi.setAttribute("TransientAttribute", Boolean.TRUE); }

    }

    }

    }

Call this method in controller (processRequest or processFormRequest).
Previous Post
Next Post

Overall 5+ Years Hands-on Experience in RICE COMPONENTS i.e. Reports, Interfaces, Conversions and Enhancements of screens/reports (using Oracle FORMS/Oracle REPORT/ XML Publisher) for standard and customize Oracle Applications. Write, debug, database packages, procedures/Function/Triggers in RDBMS using Oracle Technologies i.e. (SQL, PL/SQL) as per business requirement with SQL/PLSQL Tuning, Code Review, Testing, Training and providing Technical support to Clients.

0 comments: