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).
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).
0 comments: