Skip to main content

Using transient attributes to improve the usability of Query Panel

A simple demo application that uses transient attributes to format(re-arrange) fields displayed in model driven query component is attached here
In this sample application, query panel displays an 'Employment Date' field (which is a transient attribute) and the value keyed in for this field is mapped to a bind variable. This bind variable can be used by the Criteria Items to form the required 'where clause', based on the use case requirement. Please note that, 'display property' of Criteria Item can be controlled from the UI Hints tab (UI Hints tab -> Rendered Mode-> All/Basic/Advance/Never). In the attached sample application, first two criteria items are not displayed to the user, but the actual query is getting generated basen on these two items only.
 SELECT .... FROM JOB_HISTORY JobHistory WHERE ( ( (JobHistory.START_DATE < :bndVarEmplDate ) AND (JobHistory.END_DATE > :bndVarEmplDate ) ) )

 
ViewCriteria and the resulting Query Panel

[Runs with Oracle JDeveloper 11g R1 PS1 + HR Schema]

Comments

Popular posts from this blog

Happy New Year 2018 !

We can't go back and change the beginning, but we always can start where we are and change the ending. Believe in yourself and you will be unstoppable!

Wishing you and your family a very happy new year 2018 !!!

How to set Bind Variable Values at runtime ?

In this post I'm sharing a couple of approaches for programmatically setting bind variables values at run time. This post is an attempt to explain 'When to use what ?'[ In case if you are familiar with 'Bind Variables' in ADF BC, please refer Section 5.10, Working with Bind Variables in Fusion Developer's Guide ]

1. Set the Bind Variable value using RowSet::setNamedWhereClauseParam(...)

You can use use the setNamedWhereClauseParam(...) method on the ViewObject interface (which extends oracle.jbo.RowSet) to set the value for bind variables. Please note this sets the value on default RowSet. In other words, this doesn't have any effect on the secondary RowSets that you/system generates.
ViewObject vo = am.findViewObject("EmployeesView1"); vo.setNamedWhereClauseParam("bindVarDeptId", new Number(10)); vo.executeQuery();
2. Set the Bind Variable value using ViewObject's VariableValueManager::setVariableValue(...)

VariableValueManager Ma…