Вы находитесь на странице: 1из 6

Handling Add New Row in Advanced Table

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.

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

t .c
Below Figure shows the Structure of the Page with the Add New Row.

s po
og
. bl
ps
ap

Gyanoracleapps.blogspot.com
le
ac
or
an
gy

Gyan.ebs@gmail.com gyanoraclapps.blogspot.com
Handling Add New Row in Advanced Table
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.

om
t .c
s po
Gyanoracleapps.blogspot.com

og
. bl
ps
ap
le
ac
or
an
gy

Gyan.ebs@gmail.com gyanoraclapps.blogspot.com
Handling Add New Row in Advanced Table
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.

om
t .c
s po
og
Gyanoracleapps.blogspot.com
bl
.
ps
ap
le
ac
or
an
gy

Gyan.ebs@gmail.com gyanoraclapps.blogspot.com
Handling Add New Row in Advanced Table
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.

om
t .c
Gyanoracleapps.blogspot.com

s po
og
. bl
ps
ap
le
ac
or
an
gy

Gyan.ebs@gmail.com gyanoraclapps.blogspot.com
Handling Add New Row in Advanced Table
----------AM Code------

public void initTabQuery()


{ OAViewObject tabVO = (OAViewObject) getEmpTestVO1();
if(tabVO!=null)
{
tabVO.executeQuery();
int rowCountValue = tabVO.getRowCount();

om
Row[] allRows = tabVO.getFilteredRows("Selectflag","N");// Picks non selected row
for(int i=0; i<allRows.length; i++)
{
EmpTestVORowImpl rowRef = (EmpTestVORowImpl)allRows[i];

.c
if(rowRef!=null)
{

t
rowRef.setAttribute("ReadOnlyField",Boolean.TRUE);

po
}
}

s
}
}

og
. bl
ps
ap
le
ac
or
an

Gyanoracleapps.blogspot.com
gy

Gyan.ebs@gmail.com gyanoraclapps.blogspot.com
Handling Add New Row in Advanced Table

Now Click on Add Another Row

om
.c
Gyanoracleapps.blogspot.com

t
pos
New row created which is Editable og
. bl
ps
ap
le
ac

Gyanoracleapps.blogspot.com
or
an
gy

Gyan.ebs@gmail.com gyanoraclapps.blogspot.com

Вам также может понравиться