Skip to main content

Prart 2 - Hiding Unwanted Operators in Advanced mode of af:query Component

This is in continuation of one of my old post Part1 - Hiding Unwanted Operators in Advanced mode of af:query Component. There I discussed how to remove built-in operators (displayed in Advanced mode of af:query component) for a view criteria item attribute by specifying <CompOper/> in the view object XML file against appropriate view criteria item.

Recently I learned that, you can even  specify <CompOper/> against appropriate attributes in a view object as well. This makes your life much easier, because here you do not need to to repeat the same <CompOper/> definition across view criteria items appearing in multiple places. This also takes care of those attributes which are not included in view criteria during design time, still appearing at runtime in the search when some one adds them using Add Fields option in the Advanced mode of the query component.

Note that JDeveloper does not provide any visual aid to restrict the operators for an attribute at design time. You may need to open the appropriate view object XML in the source mode of the editor and add the <CompOper/> as appropriate. An example is here:
 <ViewAttribute  
     Name="EmployeeId"  
     IsNotNull="true"  
     PrecisionRule="true"  
     EntityAttrName="EmployeeId"  
     EntityUsage="EmployeesEO"  
     AliasName="EMPLOYEE_ID">  
     <CompOper  
       Name="Name"  
       Oper="BETWEEN"  
       ToDo="-1"  
       MinCardinality="0"  
       MaxCardinality="0"/>  
     <CompOper  
       Name="Name"  
       Oper="NOTBETWEEN"  
       ToDo="-1"  
       MinCardinality="0"  
       MaxCardinality="0"/>  
   </ViewAttribute>  

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…