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); }
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

bocadmin_ww

Search

Archives
« April 2015
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  
       
Today