Home » Developer & Programmer » Forms » can i highlight the record in a block (Oracle Form Builder 10g, Win XP)
can i highlight the record in a block [message #511020] Thu, 09 June 2011 02:39 Go to next message
new_oracle2011
Messages: 174
Registered: March 2011
Location: Qatar
Senior Member
hello everybody..

As from the title can i high light some records in a data block?

let me tell you the situation.

I am fetching almost 10 - 12 records in a datablock and it is working perfectly fine. but there are some records coming in the block which i want to make permanently red or dimmed just showing as they are black listed. is this possible?? or i have to try some other way??
Re: can i highlight the record in a block [message #511023 is a reply to message #511020] Thu, 09 June 2011 02:58 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
"Visual attribute" property of the SET_ITEM_INSTANCE_PROPERTY built-in might be what you are looking for. Here's an example: create a block based on Scott's EMP table. Create a visual attribute (let's name it LOW_SAL; background color = red, foreground color = white). Create a POST-QUERY trigger which will paint ENAME item to red if that employee has "low salary" (< 2000):
if :sal < 2000 then
   set_item_instance_property('ename', current_record, visual_attribute, 'low_sal');
end if;	

It looks like this:

/forum/fa/9084/0/

If you want to paint other items, simply name them in the same manner.
  • Attachment: low_sal.png
    (Size: 15.62KB, Downloaded 5297 times)
Re: can i highlight the record in a block [message #511027 is a reply to message #511023] Thu, 09 June 2011 03:10 Go to previous messageGo to next message
new_oracle2011
Messages: 174
Registered: March 2011
Location: Qatar
Senior Member
thank you. can we colored the whole row like u color one field?
Re: can i highlight the record in a block [message #511032 is a reply to message #511023] Thu, 09 June 2011 03:18 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Littlefoot wrote on Thu, 09 June 2011 09:58

If you want to paint other items, simply name them in the same manner.

Re: can i highlight the record in a block [message #511033 is a reply to message #511032] Thu, 09 June 2011 03:26 Go to previous messageGo to next message
new_oracle2011
Messages: 174
Registered: March 2011
Location: Qatar
Senior Member
Thanks Smile
Re: can i highlight the record in a block [message #511036 is a reply to message #511033] Thu, 09 June 2011 03:31 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Huh, I think I know what you are asking, actually: whether there's a simpler way to do that (such as "SET_RECORD_INSTANCE_PROPERTY" or similar). Unfortunately, there isn't, so you have to specify item by item:
if :sal < 2000 then
   set_item_instance_property('empno', current_record, visual_attribute, 'low_sal');
   set_item_instance_property('ename', current_record, visual_attribute, 'low_sal');
   set_item_instance_property('job'  , current_record, visual_attribute, 'low_sal');
   set_item_instance_property('mgr'  , current_record, visual_attribute, 'low_sal');
   etc.
end if;

[Updated on: Thu, 09 June 2011 03:31]

Report message to a moderator

Re: can i highlight the record in a block [message #511038 is a reply to message #511036] Thu, 09 June 2011 03:34 Go to previous messageGo to next message
new_oracle2011
Messages: 174
Registered: March 2011
Location: Qatar
Senior Member
I understood you before and I have already done this before your post. actually i was in search of something better. Anyways, its better than nothing. Thank you for this help Smile
Re: can i highlight the record in a block [message #511624 is a reply to message #511038] Tue, 14 June 2011 05:34 Go to previous messageGo to next message
new_oracle2011
Messages: 174
Registered: March 2011
Location: Qatar
Senior Member
Sorry littlefoot to disturb you again...

I want something same like as u told me before. Now i want a particular field can have insert and update allowed. i have tried the same logic but i didnt get success.
set_item_instance_property('block11.approved_amount', current_record, update_allowed, property_true);


can we do this??
Re: can i highlight the record in a block [message #511628 is a reply to message #511624] Tue, 14 June 2011 05:40 Go to previous messageGo to next message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Have you read the form builder help topic on update_allowed?
Re: can i highlight the record in a block [message #511633 is a reply to message #511628] Tue, 14 June 2011 05:51 Go to previous messageGo to next message
new_oracle2011
Messages: 174
Registered: March 2011
Location: Qatar
Senior Member
Quote:
setting UPDATE_ALLOWED to true has no effect at the item instance level unless it is set consistently at the block, item, and item instance levels.


Quote:
setting INSERT_ALLOWED to true has no effect at the item instance level unless it is set consistently at the block and item levels. For example, your user cannot type data into an item instance if INSERT_ALLOWED is true at the instance level, but not at the item or block levels.


I have found this in built-in functions for Oracle forms. This means that there is no built-in way of doing some fields allow to update or to insert having some specific data in them in a data block.
Re: can i highlight the record in a block [message #511640 is a reply to message #511633] Tue, 14 June 2011 06:16 Go to previous message
cookiemonster
Messages: 13937
Registered: September 2008
Location: Rainy Manchester
Senior Member
Of course there's a way. You just need to do the inverse of what you are doing.
Set update_allowed to true at block and item level.
Set it to false at item instance level for all items you want to disallow update on.
Previous Topic: COMMIT_FORM and DO_KEY('COMMIT_FORM') difference
Next Topic: handle huge number of rows in data block
Goto Forum:
  


Current Time: Thu Sep 12 09:02:39 CDT 2024