An interesting question came up today in the OTN JDev forum. The use case is to use an af:query component to qurey a db table, but make some of the attributes available in the table invisible in the query panel.
You can archive this using viewCriteria, but in this case you still can reach the other attributes in advanced mode.
The way to go is to make the attribute which you want to hidenot queryable in the view definition. For this we open the VO and select the attribute node.
Here we remove the check mark from the ‘Queryable’ checkbox like I did for the JobId attribute in the picture below
Now when we use this VO in a af:query component we see all queryable attributes but not the ones where we removed the check box. In the sample I removed the checkmark for JobId, ManagerId and DepartmentId in the EmployeesView. The resulting query panel which I build using the ‘All Queriable Attributes’ from the ‘Names Criteria’ section of the EmployeesView
looks like the picture below in the running application. As you can see JobId, ManagerId and DepartmentId are not part of the query panel but can be seen the result table.
In advanced mode you can’t add the missing attributes
You can remove the checkbox from the EO too, but this would mean that no VO build on this EO can query the attributes. If you only remove the checkbox in the VO you can build an other VO based on the same EO and make all attributes queriable.
You can download the sample workspace, build with JDev 11.1.2.1.0 and depending on hte HR db schema, from here: BlogCascadingTable.zip
Please rename the file to ‘.zip’ after downloading it!







Hi.
Nice post.
I think this article could be good for this topic, it deals about show / hide controls of the af:Query
http://www.notjustjava.com/2011/12/cool-tips-to-showhide-components-of-the-query-control-of-adf/
Comment by Juan — 11. January 2012 @ 12:12 |
Juan,
Thanks for pointing this (your) blog out. Did not know your blog about this issue. Keep posting…
Timo
Comment by Timo Hahn — 11. January 2012 @ 15:15 |
Hi Timo,
at first, nice post! But I have another option (ganz nach dem Motto “Viele Wege führen nach Rom”).
For the ViewCriteria I define the “Search Region Mode” with “Basic” and “Show Operators” with “in Basic mode” (because this is one killing feature…). In the UI we set the “modeChangeVisible” to “false” for the af:query-component. Thats all. Now the User can change the operators but can not add new fields.
The two screenshots to explain the better:
http://img823.imageshack.us/img823/5798/afquery01.png
http://img714.imageshack.us/img714/5944/afquery02.png
best regards
Martin
Comment by Martin — 16. January 2012 @ 20:20 |