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