Making the Table Rows Read-Only - Gyan
Click here to load reader
-
Upload
gyan-darpan -
Category
Documents
-
view
2.054 -
download
2
Transcript of Making the Table Rows Read-Only - Gyan
gyan
oracle
apps
.blog
spot.
com
Handling Add New Row in Advanced Table
[email protected] gyanoraclapps.blogspot.com
I have seen a lot of discussion in the oracle forum…Where the user want to populate the data in Read-
only mode for all the fetched row’s from the VO’s. And when they click on Add New Row, it must be in
the form of User Editable field.
Step 1 –Create a Transient Attribute in the View Object attached to the Advanced 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.
Below Figure shows the Structure of the Page with the Add New Row.
Gyanoracleapps.blogspot.com
gyan
oracle
apps
.blog
spot.
com
Handling Add New Row in Advanced Table
[email protected] gyanoraclapps.blogspot.com
Step 1- Create a VO with the following Query and attach the same with the Advanced Table.
Example – I took FWK_TBX_EMPLOYEES table. Attached a SelectFlag with ‘N’.
Below Figure show the Query attached with the VO.
Gyanoracleapps.blogspot.com
gyan
oracle
apps
.blog
spot.
com
Handling Add New Row in Advanced Table
[email protected] gyanoraclapps.blogspot.com
Step 2 – Create a Transient Attribute in the VO attached with the table with type as BOOLEAN &
UPDATEABLE Always.
Below Figure shows the transient attribute Properties.
Gyanoracleapps.blogspot.com
gyan
oracle
apps
.blog
spot.
com
Handling Add New Row in Advanced Table
[email protected] gyanoraclapps.blogspot.com
Step 3 – Write the below code in the AM. This method is used to set the Read-only Property to TRUE for
each rows in the table.
Gyanoracleapps.blogspot.com
gyan
oracle
apps
.blog
spot.
com
Handling Add New Row in Advanced Table
[email protected] gyanoraclapps.blogspot.com
----------AM Code------
public void initTabQuery()
{ OAViewObject tabVO = (OAViewObject) getEmpTestVO1();
if(tabVO!=null) { tabVO.executeQuery(); int rowCountValue = tabVO.getRowCount(); Row[] allRows = tabVO.getFilteredRows("Selectflag","N");// Picks non selected row for(int i=0; i<allRows.length; i++) { EmpTestVORowImpl rowRef = (EmpTestVORowImpl)allRows[i]; if(rowRef!=null) { rowRef.setAttribute("ReadOnlyField",Boolean.TRUE); } } } }
Gyanoracleapps.blogspot.com
gyan
oracle
apps
.blog
spot.
com
Handling Add New Row in Advanced Table
[email protected] gyanoraclapps.blogspot.com
Now Click on Add Another Row
New row created which is Editable
Gyanoracleapps.blogspot.com
Gyanoracleapps.blogspot.com