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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to set attribute in adf defalut search form query

Salman5Apr 2 2014 — edited Apr 2 2014

I am using the default search form in Jdeveloper 11.1.2.3 Query with Table.

I follow this blog to override the default query:   https://blogs.oracle.com/jdevotnharvest/entry/how-to_tell_the_viewcriteria_a_user_chose_in_an_afquery_component

Question is how to set the value of some attribute in the query. The user will add what ever he/she want to the search form and those are captured queryEvent I want to add the value of some attribute that is not shown to the user and it is required for the query to execute correctly.

This post has been answered by Arunkumar Ramamoorthy-Oracle on Apr 2 2014
Jump to Answer

Comments

Cvele_new_account
FilterableQueryDescriptor filterQD = (FilterableQueryDescriptor)queryEvent.getDescriptor();

Map filterCrit = filterQD.getFilterCriteria();

filterCrit.put("YourAttribute", some_value);

Salman5

Thanks a lot Cvele your are always a life saver

I tried your way but I always get NullPointerException on the last line of your code

filterCrit.put("YourAttribute", some_value);


for the first parameter I tried both the name in the view object ( ex. EmployeeId ) and the one in the query ( EMPLOYEE_ID) both ways gives me NullPointerException.


For the second parameter ( some_value) I am hard coding it for testing purpose. So, the Exception is not from it

Cvele_new_account

Just to verify something:

After

Map filterCrit = filterQD.getFilterCriteria();

check to see if filterCrit is null ,at least with

System.out.println("filterCrit = " + filterCrit);

and let me know...

Salman5

Thanks Arun,

But this blog does not add a value to the query parameter. What I want is to be able to set the value of some query attributes and combined them with the user search attributes. I follow Cvele way but I am getting NullPointerException

Salman5

Yes , It is Null. Do I miss any thing ?

Salman5

I do not know if that's helpful. But, I am using the default Criteria (All Queriable Attributes )

Answer

Hi,

If you had gone through the blog i've posted, you could get the ViewCriteriaRow from the queryEvent and then you could add the attribute  which you want to the ViewCriteriaRow and then execute the query accordingly.


-Arun

Marked as Answer by Salman5 · Sep 27 2020
Salman5

THANK YOU

It's Working Aurn

1 - 9
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 30 2014
Added on Apr 2 2014
9 comments
2,435 views