Tuesday, 16 December 2014

how to hide and resize fields within af:query panel

If you're using af:query forms probably you've encountered an issue with the list of queryable fields. The list should be limited only to few of them, some values shouldn't be updateable and so on. Textboxes dimensions were too big or too small. Sounds familiar?

First I'll distinguish the problem with the list of fields that are rendered within af:query. Option "All queriable attributes" is exactly what the name says. Each attribute from view object which Queryable checkbox is set will be listed there. No additional comments here.

Next, each bind variable marked as Required, or in other words, which Kind="where" will be listed in af:query by default.

To hide it just change it's Display Hint property to Hide for instance using Property Inspector.

Third and last possibility are view criterias and related view criteria rows and bind variables (which Kind="viewcriteria"). I've defined view criterias as shown below. Please go to UI Hints tab.

A bit of magic is hidden there. You can specify where the criterias should be applied (in database, in memory or both), default mode (Basic or Advanced). When Query automatically isn't selected by default you'll receive an empty row set. Otherwise the query will be executed on database. From af:query point of view i'd like to list only few view criteria rows in the panel. Just select one row from Criteria Item UI Hints and change its Render Mode to Never.

And what about text boxes dimensions? Please review the steps performed here and play with Display Width control hint :)