Main | September 2008 »

July 2008 Archives

July 17, 2008

MultiSelect on Read Only View Object Tables - ADF 10.1.3.3

View object query created with "Updatable Access through Entity Object option" checked
Can use below code to access selected attribute values of the multiSelect table.

DCIteratorBinding depIter =
ResultADFUtils.findIterator("TableIterator");
RowSetIterator depRSIter = depIter.getRowSetIterator();
RowKeySet selection = this.getTable().getSelectionState();
Set keySet = selection.getKeySet();
Iterator itr = keySet.iterator();

while (itr.hasNext()) {
Key key = (Key)itr.next();
ViewRowImpl row = (ViewRowImpl)depRSIter.getRow(key);
wherePart += row.getAttribute(0);
}

Above code does not work for View Object query created with "Read Only Access" Option checked. You may notice exception as shown below.

"Caused by: javax.faces.el.EvaluationException: java.lang.ClassCastException: java.lang.Integer at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:150) at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92) ... 29 "

Altering code as shown below fixes exception.

DCIteratorBinding depIter =
ResultADFUtils.findIterator("TableIterator");
RowSetIterator depRSIter = depIter.getRowSetIterator();

RowKeySet selection = this.getTable().getSelectionState();
Set keySet = selection.getKeySet();
Iterator itr = keySet.iterator();

while (itr.hasNext()) {
String x = itr.next().toString();
int y = Integer.parseInt(x);
Row row = depRSIter.getRowAtRangeIndex(y);
wherePart += row.getAttribute(0);
}


July 23, 2008

Calculated Columns cannot be Updateable - ADF 10.1.3.3

Had a requirement to create description column in XYZ table and provide feature to edit description. The XYZ table View Object was created using Read Only Mode with Expert flag set, I created new column and did sync at entity level and then edited View Object to add description column, the description column appear in attributes as Calculated column.

I used Calculated Description column for editing, unfortunately didn't see data getting updated.
Then removed Calcualted column in VO and selected XYZ table from entity within VO wizard and unchecked Expert flag, this time i see Description column shown in attributes as TableName.Description instead of Calculated.Description and now I used TableName.Description for editing, I see record updated after changes made in Description.

About July 2008

This page contains all entries posted to Raghu Yadav's Weblog in July 2008. They are listed from oldest to newest.

September 2008 is the next archive.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle