Home » Developer & Programmer » Forms » reset validate_from_list property to its design time value
reset validate_from_list property to its design time value [message #413477] Thu, 16 July 2009 00:01 Go to next message
salman2k960
Messages: 12
Registered: September 2005
Junior Member
Scenario:
A text Item named "abc" has lov "xyz" attached. furthermore,validate_from_list property of "abc" is "no" at design time. lets say while execution of the form, following code changes the property:

set_item_property("abc",validate_from_list,property_true);

NOW, what i want to do is to reset this property to its design time value. reading the oracle form documentation which says

"If you want to reset the value of the property to be the value originally established for it at design time, enter two single quotes with no space between: ''. For example, SET_ITEM_PROPERTY('DEPTNO', FORMAT_MASK, ''); would reset that format mask to its design-time value. "

BUT, following statement is not working:

set_item_property("abc",validate_from_list,'');

the result of GET_ITEM_PROPERTY("abc",validate_from_list) is still "TRUE" where it should have been "FALSE".

is it a bug or am i really missing some other settings?

Regards

Re: reset validate_from_list property to its design time value [message #413673 is a reply to message #413477] Fri, 17 July 2009 00:30 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Well, you might first find default setting (in a WHEN-NEW-FORM-INSTANCE trigger, perhaps?) and "remember" it in a global variable or a parameter. Then, when you'd want to reestablish such a state, you might use IF-THEN-ELSE and set it back. I admit, I didn't try but ... you might.

By the way, all you've said seems to be OK. I wouldn't know why two single quotes didn't do the job.
Re: reset validate_from_list property to its design time value [message #414425 is a reply to message #413477] Wed, 22 July 2009 02:08 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
In Forms 10g I defined 'Validate from List' for 'dummy' as 'true' and then ran this code in a 'When-Button-Pressed' trigger:
declare
  l_var varchar2(100);
begin
  l_var := get_item_property('dummy',validate_from_list);
  message('l_var=>'||l_var||'<');
  pause;
  set_item_property('dummy',validate_from_list,property_false);
  l_var := get_item_property('dummy',validate_from_list);
  message('l_var=>'||l_var||'<');
  pause;
  set_item_property('dummy',validate_from_list,'');
  l_var := get_item_property('dummy',validate_from_list);
  message('l_var=>'||l_var||'<');
  pause;
end;

The messages I received were 'TRUE', 'FALSE', and then 'TRUE'.

David
Re: reset validate_from_list property to its design time value [message #414720 is a reply to message #414425] Thu, 23 July 2009 05:28 Go to previous messageGo to next message
salman2k960
Messages: 12
Registered: September 2005
Junior Member
thanx for your replies.
Global variable solution is not generic, so i cant use it.
Im getting this problem in forms 6i (appologies for not mentioning earlier)
im disappointed, anyways...thanx to all.
Re: reset validate_from_list property to its design time value [message #414873 is a reply to message #414720] Thu, 23 July 2009 22:53 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
The item 'dummy' belongs to a block based on 'dual'. So it is not a 'global' in the ':global' sense. So use ANY item in your form with my code and tell us the result that you obtain when you run it.

David
Re: reset validate_from_list property to its design time value [message #414888 is a reply to message #414873] Thu, 23 July 2009 23:34 Go to previous messageGo to next message
salman2k960
Messages: 12
Registered: September 2005
Junior Member
David:
When i run your code, it runs fine.
But the difference is in the start. Just try your code again but with "Validate_from_list" property to "False" initially rather than "True".
Even your code will give wrong results. Results will be :-
'FALSE', 'FALSE','TRUE'
whereas it should have been :-
'FALSE', 'FALSE','FALSE'

Regards
Re: reset validate_from_list property to its design time value [message #414904 is a reply to message #414888] Fri, 24 July 2009 00:16 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
From reading the reference manual I can't see anything that suggests the functionality for which you are looking exists. You will have to do what Littlefoot recommended and that is store the value and then use that information to reset it.

David
Previous Topic: navigation-in-enter-query-mode
Next Topic: Error in Export ORACLE error 12154 encountered
Goto Forum:
  


Current Time: Fri Dec 09 08:04:58 CST 2016

Total time taken to generate the page: 0.22208 seconds