Home » Developer & Programmer » Forms » Change The color of label upon choosing value (Forms 6i)
Change The color of label upon choosing value [message #403512] Sat, 16 May 2009 02:25 Go to next message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

Hi folks can anyone tell me how i can change the color of label based on value of item selected from the list.That is i have list of projects and this project have a status field whether it is closed or not closed.if user chooses any project which is closed i want this label to be green otherwise label to be red.
Re: Change The color of label upon choosing value [message #403520 is a reply to message #403512] Sat, 16 May 2009 05:39 Go to previous messageGo to next message
klat
Messages: 87
Registered: May 2009
Location: Mumbai
Member

Hi

Try SET_ITEM_PROPERTY(<Item Name>,PROMPT_FOREGROUND_COLOR,<color>)

Re: Change The color of label upon choosing value [message #403521 is a reply to message #403520] Sat, 16 May 2009 05:42 Go to previous messageGo to next message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

but do i need to put inside when list change trigger or how can i change colours based on values
Re: Change The color of label upon choosing value [message #403523 is a reply to message #403521] Sat, 16 May 2009 05:56 Go to previous messageGo to next message
klat
Messages: 87
Registered: May 2009
Location: Mumbai
Member

try in when_list_changed trigger

what is your status field item??
Is it a display Item?
then you can chage the foreground_color of the display item by using set_item_property.
Re: Change The color of label upon choosing value [message #403526 is a reply to message #403523] Sat, 16 May 2009 06:27 Go to previous messageGo to next message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

Actually i m taking the value from one table ot_job_head
for a field jh_appr_status if that status is 1 it must be red and if the chosen value is 3 then green.

The item which has to be highlighted is text item and used only for display purposes.

I already have one trigger written on when list changed so how can i add another proceedure
Re: Change The color of label upon choosing value [message #403533 is a reply to message #403526] Sat, 16 May 2009 09:47 Go to previous messageGo to next message
klat
Messages: 87
Registered: May 2009
Location: Mumbai
Member

Add in your when_list_changed trigger

<your existing code>


if :jh_appr_status = 1 then
set_item_property(...);
else
set_item_property(..);
end if;

Re: Change The color of label upon choosing value [message #403563 is a reply to message #403533] Sun, 17 May 2009 00:55 Go to previous messageGo to next message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

First , thanks for your support . Can you give me the exact syntax of set item property . Secondly i would like to tell you that already i am using the when list change trigger to populate another list but how can i merge this if statement with that

declare
rg_id recordgroup := find_group('LOCN') ;
ln_error number ;
begin
if not id_null(rg_id) then
ln_error := populate_group(rg_id) ;
if ln_error = 0 then
populate_list('IP_REP_INFO.TEXT_ITEM108' , rg_id) ;

else
message('Error in Populating Group') ;
end if ;
end if ;

end ;

can i add two functionalities together that is i need to populate the second list based on first list and then change the color of text item based on jh_appr_status if its 1 then red color else if its 3 then green color.
Re: Change The color of label upon choosing value [message #403578 is a reply to message #403563] Sun, 17 May 2009 03:42 Go to previous messageGo to next message
klat
Messages: 87
Registered: May 2009
Location: Mumbai
Member

Quote:

can i add two functionalities together that is i need to populate the second list based on first list and then change the color of text item based on jh_appr_status if its 1 then red color else if its 3 then green color.



YES.

You can get the syntax of all builtin functions through form builder help.
Help -> Online Help

Attach your form.

Re: Change The color of label upon choosing value [message #403580 is a reply to message #403578] Sun, 17 May 2009 03:53 Go to previous messageGo to next message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

hi klat i am attaching the form for your reference i tried to add the condition in when list change and when validate item but still not working.please check
  • Attachment: JOBCLOSE.fmb
    (Size: 800.00KB, Downloaded 176 times)
Re: Change The color of label upon choosing value [message #403586 is a reply to message #403580] Sun, 17 May 2009 04:40 Go to previous messageGo to next message
klat
Messages: 87
Registered: May 2009
Location: Mumbai
Member

Find this form .
It will help you.

  • Attachment: TEST.fmb
    (Size: 44.00KB, Downloaded 204 times)
Re: Change The color of label upon choosing value [message #403596 is a reply to message #403586] Sun, 17 May 2009 06:33 Go to previous message
arif_md2009
Messages: 732
Registered: May 2009
Location: United Arab Emirates
Senior Member

THANKS VERY MUCH I GOT IT DONE....
Previous Topic: When tab page selected show different
Next Topic: Text Moving on the Form
Goto Forum:
  


Current Time: Fri Dec 09 17:52:42 CST 2016

Total time taken to generate the page: 0.59478 seconds