Home » Developer & Programmer » Forms » to make text-box invisible at run time (Suit 10g)
to make text-box invisible at run time [message #658182] Tue, 06 December 2016 07:00 Go to next message
kumarravik
Messages: 32
Registered: January 2016
Location: delhi
Member
Hi there,

I want a text-box to be remain invisible when form loads. So at form level trigger (When-new-form-instance) i have written this code.

set_item_property(':BLK_EMP.txt_msg', enabled, property_false)

that text should be visible with some hard-code value when a button pressed. So i have written below code (on when-button-pressed)

set_item_property(':BLK_EMP.txt_msg',enabled,property_true);

But i am not getting expected result. also, while running the form, i am getting an exception error "FRM-40105:UNABLE TO RESOLVE REFERENCE TO ITEM"

[Updated on: Tue, 06 December 2016 07:04]

Report message to a moderator

Re: to make text-box invisible at run time [message #658184 is a reply to message #658182] Tue, 06 December 2016 07:58 Go to previous messageGo to next message
cookiemonster
Messages: 13961
Registered: September 2008
Location: Rainy Manchester
Senior Member
You shouldn't include the : when referencing item names in calls to built-ins like set_item_property.
Also enabled doesn't make items invisible, the visible property does that.
Re: to make text-box invisible at run time [message #658214 is a reply to message #658184] Wed, 07 December 2016 04:04 Go to previous messageGo to next message
kumarravik
Messages: 32
Registered: January 2016
Location: delhi
Member
Thank you for the input. That way the exceptions will be removed.

Now, I have left with only first query not getting expected result.

I can make the text-box Invisible through property after that please guide me write the code to make it visible on the click of a button?
Re: to make text-box invisible at run time [message #658216 is a reply to message #658214] Wed, 07 December 2016 04:18 Go to previous messageGo to next message
cookiemonster
Messages: 13961
Registered: September 2008
Location: Rainy Manchester
Senior Member
you use set_item_property to set visible for that item to true of course.
Re: to make text-box invisible at run time [message #658222 is a reply to message #658216] Wed, 07 December 2016 05:13 Go to previous messageGo to next message
kumarravik
Messages: 32
Registered: January 2016
Location: delhi
Member
Not working.

I have made the property to Invisible then written below code to display the text-box on button click.

set_item_property('BLK_EMP.TXT_MSG',enabled,property_true);

It gets compiled well but receiving this error "FRM-41033: CANNOT SET ENABLED ATTRIBUTE OF NON-VISIBLE.."
Re: to make text-box invisible at run time [message #658238 is a reply to message #658216] Wed, 07 December 2016 07:27 Go to previous messageGo to next message
cookiemonster
Messages: 13961
Registered: September 2008
Location: Rainy Manchester
Senior Member
What on earth did you expect to happen?
Isn't the error message obvious?
You've set the visible property and then decided to reverse that change by changing some other property.
Re-Read this and pay attention this time.
cookiemonster wrote on Wed, 07 December 2016 10:18
you use set_item_property to set visible for that item to true of course.

Re: to make text-box invisible at run time [message #658263 is a reply to message #658238] Wed, 07 December 2016 12:47 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Just in case you didn't read Online Forms Help (which you really should), there's a note for you:
Oracle

Note: Setting Visible to false will cause other item property settings to change. Consult the "Propagation of Property Changes" section for details.

It means that - once you make it invisible - some other properties (such as enabled and navigable) will change as well, so you'll have to restore their original settings.
Re: to make text-box invisible at run time [message #658319 is a reply to message #658263] Fri, 09 December 2016 07:00 Go to previous message
kumarravik
Messages: 32
Registered: January 2016
Location: delhi
Member
Dear Cookiemonster,

thank you for the advice. I missed your word , sorry for that Sad .

It is working well now.

when i click the button, it shows the text-box. I changed the font color and background color of text-box to red in property but it remain gray while running? tried with visual attribute but only background color is changing not the font of text msg i am trying to display in it.

Also, how to remove this text-box, when user click on clear field button ?

[Updated on: Fri, 09 December 2016 08:14]

Report message to a moderator

Previous Topic: CALENDER USAGE ERROR: <FormName> navigated directly to Calender
Next Topic: When-validate-item on a single field block
Goto Forum:
  


Current Time: Thu Dec 12 07:11:07 CST 2024