Different ways of setting bind variable value in ADF
Hi All,
Today we are going to see by how many ways you can set the bind variable value.
We can set the bind variable value by following methods:
1) setNamedWhereClauseParam()
2) setVariableValue() of VariableValueManager
3) defineNamedWhereClauseParam()
4) By Setter Method in ViewObjectImpl
Lets see all one by one.
1) setNamedWhereClauseParam()
This is one of the method by which we can set the bind parameter value. This method will set the bind variable value for the default row set only.
You can use this method in following manner.
ViewObject vo = am.findViewObject("EmployeesVO1");
vo.setNamedWhereClauseParam("bind_emp", new Number(10));
vo.executeQuery();
2) setVariableValue() of VariableValueManager
This is the another way of setting bind variable value. This method will set the bind variable value for all row set.
You can use this method in following manner:
ViewObject vo = am.findViewObject("EmployeesVO1");
VariableValueManager vm = vo.ensureVariableManager();
vm.setVariableValue("bindVariableName", value);
vo.executeQuery();
3) defineNamedWhereClauseParam()
This method is used to set the bind variable value for those bind variable which are defined at run time as shown below:
ViewObject vo = am.findViewObject("EmployeesVO1");
vo.setWhereClause("EmployeesEO.FIRST_NAME= :bind_ename");
vo.defineNamedWhereClauseParam("bind_ename", null, null);
vo.setNamedWhereClauseParam("bind_ename", "nj");
vo.executeQuery();
In above example we have set the dynamic where clause and we have defined the dynamic bind variable with name bind_ename.
4) By Setter Method in ViewObjectImpl
In order to set the bind variable value by setter method you have to do the following steps:
a) Go to java section of your view object and generate the VOImpl class with check box check "Include bind variable accessors"
b) Then get the Instance of the VOImpl and call the setter method of that bind variable.
One thing here you can notice that it internally uses setVariableValue method only.
That is all about setting bind variable value in ADF.
Happy Coding :)
Today we are going to see by how many ways you can set the bind variable value.
We can set the bind variable value by following methods:
1) setNamedWhereClauseParam()
2) setVariableValue() of VariableValueManager
3) defineNamedWhereClauseParam()
4) By Setter Method in ViewObjectImpl
Lets see all one by one.
1) setNamedWhereClauseParam()
This is one of the method by which we can set the bind parameter value. This method will set the bind variable value for the default row set only.
You can use this method in following manner.
ViewObject vo = am.findViewObject("EmployeesVO1");
vo.setNamedWhereClauseParam("bind_emp", new Number(10));
vo.executeQuery();
2) setVariableValue() of VariableValueManager
This is the another way of setting bind variable value. This method will set the bind variable value for all row set.
You can use this method in following manner:
ViewObject vo = am.findViewObject("EmployeesVO1");
VariableValueManager vm = vo.ensureVariableManager();
vm.setVariableValue("bindVariableName", value);
vo.executeQuery();
3) defineNamedWhereClauseParam()
This method is used to set the bind variable value for those bind variable which are defined at run time as shown below:
ViewObject vo = am.findViewObject("EmployeesVO1");
vo.setWhereClause("EmployeesEO.FIRST_NAME= :bind_ename");
vo.defineNamedWhereClauseParam("bind_ename", null, null);
vo.setNamedWhereClauseParam("bind_ename", "nj");
vo.executeQuery();
In above example we have set the dynamic where clause and we have defined the dynamic bind variable with name bind_ename.
4) By Setter Method in ViewObjectImpl
In order to set the bind variable value by setter method you have to do the following steps:
a) Go to java section of your view object and generate the VOImpl class with check box check "Include bind variable accessors"
b) Then get the Instance of the VOImpl and call the setter method of that bind variable.
One thing here you can notice that it internally uses setVariableValue method only.
That is all about setting bind variable value in ADF.
Happy Coding :)
Hi Kunal,
ReplyDeleteI am having a use case where I am using 'Input List of Values' component for providing option to choose from a list of values. My data control is giving me the values 'WWD','PPO','SDO','UXP'...etc. During the runtime, the 'Input List of Values' component is showing first value 'WWD' in the textbox with option(search icon) to choose other values. My requirement is to display blank value(empty) the text field and when user clicks on search icon, the popup box should allow user to choose from that list. Please suggest the needful.
Thanks
Thanks for great description. I have got a scenario on that uses POJO as VO. These Pojos do not have relations on business model side but in underlying platform which is LDAP based. on UI side I want to view them accordingly, for example if I click a row in role table the corresponding users in users table update. would you please help me on this scenario?
ReplyDeleteThanks
great
ReplyDeletePerfect
ReplyDeleteInspiring writings and I greatly admired what you have to say , I hope you continue to provide new ideas for us all and greetings success always for you..Keep update more information..
ReplyDeleteSelenium training in Pune
Selenium Online training
Selenium interview questions and answers
Selenium interview questions and answers
Selenium Online training
Wonderful Blog!!! Thanks for sharing this post with us... and it is more helpful for us.
ReplyDeleteIOS Training in Chennai
iOS Course in Chennai
Best ios Training institutes in Chennai
IOS Training in Velachery
IOS training in Adyar
Python Training in Chennai
Software testing training in chennai
JAVA Training in Chennai
Very informative blog. Got more information about this technology.
ReplyDeleteIonic Training in Chennai
Ionic Training Institute in Chennai
pearson vue test center in chennai
IoT Training in Chennai
Xamarin Training in Chennai
Node JS Training in Chennai
Ionic Training in Anna Nagar
Ionic Training in T Nagar
Get inspired by your blog. Keep doing like this....
ReplyDeleteTally Course in Chennai
Tally training in coimbatore
Tally course in madurai
Tally Classes in Chennai
tally classes in coimbatore
tally coaching centre in coimbatore
tally training institute in coimbatore
Software Testing Training in Chennai
It’s really great information for becoming a better Blogger. Keep sharing, Thanks...
ReplyDeleteLearn Hadoop Training from the Industry Experts we bridge the gap between the need of the industry. Softgen Infotech provide the Best Hadoop Training in Bangalore with 100% Placement Assistance. Book a Free Demo Today.
Big Data Analytics Training in Bangalore
Tableau Training in Bangalore
Data Science Training in Bangalore
Workday Training in Bangalore
Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
ReplyDeletesap hana courses in bangalore
sap hana classes in bangalore
sap hana training institute in bangalore
sap hana course syllabus
best sap hana training
sap hana training centers
best sap hana training
Thanks for sharing this blog. This very important and informative blog
ReplyDeletesap mm training in bangalore
sap mm courses in bangalore
sap mm classes in bangalore
sap mm training institute in bangalore
sap mm course syllabus
best sap mm training
sap mm training centers
Thanks for this blog, I'am very much delighted to say that this blog has helped me a lot in gain some extra knowledge.
ReplyDeleteSelenium Training in chennai | Selenium Training in anna nagar | Selenium Training in omr | Selenium Training in porur | Selenium Training in tambaram | Selenium Training in velachery
Such an awesome post it is.Keep going.
ReplyDeleteJava training in Chennai
Java training in Bangalore
Java training in Hyderabad
Java Training in Coimbatore
Java Online Training