Home » Developer & Programmer » Forms » dynamic item instance control
dynamic item instance control [message #616564] Wed, 18 June 2014 05:58 Go to next message
Messages: 2
Registered: June 2014
Location: Kuwait
Junior Member
Hi friends,
My Oracle forms version is and
database version is
Oracle Database 10g Enterprise Edition Release - 64bi
PL/SQL Release - Production
CORE Production
TNS for 64-bit Windows: Version - Production
NLSRTL Version - Production

i have a datablock in form,which is popolating a data like this type :
Family	Department Product Quantity

1	10	   abc	   1
1	10  	   pqr	   2
3	10	   abx	   3
3	15	   pqr	   2
4	40	   abc	   4

My question is
1) how to display same visual attribute for all the records which have same value for column "FAMILY".

for Eg : In above record for Family 1, i want to highlight 2 top records when user navigates to first or second record.
Similarly when user navigate to Family 3,containing 3rd and 4th record should be highlighted.


[EDITED by LF: applied [pre] tags to preserve formatting]

[Updated on: Thu, 19 June 2014 02:08] by Moderator

Report message to a moderator

Re: dynamic item instance control [message #616620 is a reply to message #616564] Thu, 19 June 2014 02:31 Go to previous messageGo to next message
Messages: 21127
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Shortly: I don't see a way to do that.

Here's what I thought and why I came to that conclusion.

Obviously, you'd have to create two visual attributes (one which highlights item, and another one which returns them to normal state. Also, two parameters would be used - one would indicate current record number, another would contain family item's value.

One option is to use key navigation (i.e. KEY-UP and KEY-DOWN triggers). You'd set record number parameter's value to :SYSTEM.TRIGGER_RECORD and family parameter's value to current FAMILY item value.

KEY-xxx triggers would contain a loop which should loop through all block records; these *should* be KEY-xxx triggers because you can use restricted procedures in them (such as NEXT_RECORD or PREVIOUS_RECORD). You'd then compare that record's FAMILY item value with the one stored in the parameter. If they match, apply the highlighting visual attribute (see SET_ITEM_PROPERTY built-in). If not, set it to normal.

Obvious disadvantage: key navigation ... users do use mouses, don't they?

Another option uses the same parameters and visual attributes, but this time every navigation to another record saves FAMILY value into the parameter, preforms EXECUTE_QUERY, uses POST-QUERY trigger which compares FAMILY item value with the parameter and applies (or not) the visual attribute.

Obvious disadvantages: blocks that contain numerous records; requerying all the time might take ages. Also, I can't think of any suitable trigger to initiate EXECUTE_QUERY.

Hopefully, someone else will have a better & working idea. I don't, sorry.
Re: dynamic item instance control [message #616635 is a reply to message #616620] Thu, 19 June 2014 04:13 Go to previous message
Messages: 9
Registered: June 2014
Location: Germany
Junior Member
With "display_item", you are able to change the visual attribute in post-query.

if :FAMILY='1' then
elsif :FAMILY)='2' then

To change the color on the current record and all same records is more difficult. I don't try it, but i think you need a procedure that starting with the current record moves up til the "family" changes and down til the family changes. Every record with the same "family" you have to change with display_item. Because the moves are only around the current record, it shouldn't be to much moving - depends on the count of records you are working with.
Previous Topic: Disabling all the block except single item
Next Topic: Opening multiple forms in a session
Goto Forum:

Current Time: Sun Jul 23 11:50:37 CDT 2017

Total time taken to generate the page: 0.10657 seconds