Home » Developer & Programmer » Forms » property rest on item disable
property rest on item disable [message #170617] Thu, 04 May 2006 08:54 Go to next message
annagel
Messages: 220
Registered: April 2006
Senior Member
This one is just a simple one compared to yesterday's problem just searching for info that I have been unable to find on my own. I am using Oracle Forms Builder 6i. In my form I am enabling and disabling fields depending on the state of the form to try and force the user to not play around with things they shouldn't until the appropriate time. To do this I do something like this:

--to enable it
set_item_property('cs3_data.street', enabled, property_true);
--to disable it
set_item_property('cs3_data.street', enabled, property_false);


This all works fine for the enabling and disabling, however I run into two problems.

First when I set the enabled property to false, the field looses other properties that have been set. For my purpose the important ones are required, previous navigation item, and next navigation item. If I need to I could modify my enable code to go and reset these properties as well but, I would rather not if there is a way to simply not loose the property in the first place.

Second when I try to disable a field that has the user's cursor in it I get an error and the field does not disable until the user moves their cursor to another field. Is there a way I can take out the middle man and do this myself, just send their cursor to a field of my choosing before I disable to fields?
Re: property rest on item disable [message #170632 is a reply to message #170617] Thu, 04 May 2006 09:55 Go to previous messageGo to next message
annagel
Messages: 220
Registered: April 2006
Senior Member
"Second when I try to disable a field that has the user's cursor in it I get an error and the field does not disable until the user moves their cursor to another field. Is there a way I can take out the middle man and do this myself, just send their cursor to a field of my choosing before I disable to fields?"

Figured this one out using the go_item procedure..still have not found anything for my first problem however. Really not looking forward to reseting all those values so I think I will hold off for now and hope someone knows of something.
Re: property rest on item disable [message #170645 is a reply to message #170617] Thu, 04 May 2006 10:57 Go to previous messageGo to next message
annagel
Messages: 220
Registered: April 2006
Senior Member
"First when I set the enabled property to false, the field looses other properties that have been set. For my purpose the important ones are required, previous navigation item, and next navigation item. If I need to I could modify my enable code to go and reset these properties as well but, I would rather not if there is a way to simply not loose the property in the first place."

The more I read about this the more I think it is not possible to not have to reset some values here. Just reading some more of the documentation on set_item_property and how it works it looks like the only way to have it change more than one property at a time (as it is doing when I disable the fields) is to have it required by the change you are making which is the case when you disable the field. So I have resigned myself to simply changing the properties back to what they should be.
Re: property rest on item disable [message #170700 is a reply to message #170645] Thu, 04 May 2006 18:53 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
In the reference manual there is a matrix at the end of Set_Item_Property entry that describes which OTHER properties are turned off when an item is disabled, and the order in which they must be re-enabled. Concerning navigation, I suggest that you have the items defined in the block in the order in which you wish to traverse them, that way, when you 'turn one off' forms will automatically jump to the 'following' item.

David
Re: property rest on item disable [message #170832 is a reply to message #170700] Fri, 05 May 2006 07:20 Go to previous message
annagel
Messages: 220
Registered: April 2006
Senior Member
I figured it out after finding that matrix. I had read further up about the property specifcally, but stumbled on the info on what gets disabled when you setcertain properies when I was looking for something else.
Previous Topic: calender in Form
Next Topic: run microsoft word from my form
Goto Forum:
  


Current Time: Fri Sep 20 09:23:38 CDT 2024