Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to filter an LOV inside an af:table (no binding attribute value) (JDev 12.2.1.2.)

Mehdi EsteghamatianJan 31 2018 — edited Feb 24 2018

I have a table connected to a detail PayLoanView and one of the fields has an LOV as defined as per below snapshot.

pastedImage_0.png

pastedImage_0.png

pastedImage_2.png]

the LOV field is a table column.

pastedImage_1.png

pastedImage_2.png

Requirement

I used to filter the LOV programmatically like below.

| | public void filterLoanItemTypes(LaunchPopupEvent launchPopupEvent) { |
| | DCBindingContainer binding = BindingsUtil.getBindingContainer(); |
| | FacesCtrlLOVBinding lov = (FacesCtrlLOVBinding)binding.get("PitmDesc"); |
| | lov.getViewObject().setWhereClause("ITEM_TYPE = 3"); |
| | } |

But I get the NPE exception although I have defined the an attribute variable to for the attribute containing the LOV.

on line lov.getViewObject().setWhereClause("ITEM_TYPE = 3");

lov is null apparently ... then defined an attribute binding for it ....like below.

pastedImage_11.png

But then I got the below error:

Caused by: java.lang.ClassCastException: oracle.adfinternal.view.faces.model.binding.FacesCtrlAttrsBinding cannot be cast to oracle.adfinternal.view.faces.model.binding.FacesCtrlLOVBinding

at pay.view.bean.basicinfo.PersonnelBasicInfoBean.filterLoanItemTypes(PersonnelBasicInfoBean.java:522)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at com.sun.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:181)

at com.sun.el.parser.AstValue.invoke(AstValue.java:289)

at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)

at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)

What is the solution programmatically ...???

Any clue is much apprecite it.

thx

Mike

This post has been answered by Robert Ĺ ajina on Jan 31 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 28 2018
Added on Jan 31 2018
2 comments
368 views