Home » Developer & Programmer » Forms » Problems w/ Form buttons
Problems w/ Form buttons [message #176304] Wed, 07 June 2006 14:26 Go to next message
sikorsky05
Messages: 40
Registered: October 2005
Member
I have this form

http://www.cs.uofs.edu/~sa3/Doc1.html

I have the following trigger set on Check button


Declare


CURSOR D IS
SELECT incoming,incoming_std_pn,FSCM,correct_std_pn,modelf,in_val,in_lru
from siksxa.temp;
DD D%ROWTYPE;

Begin

For DD in D loop

IF DD.IN_VAL = 'YES' THEN
set_item_property('TEMP1.SAVE_IN_VAL',ENABLED, property_false);
set_item_property('TEMP1.SAVE_IN_VAL2',ENABLED,property_false);
set_item_property('BLOCK288.SAVE_IN_VAL',ENABLED,
property_false);
set_item_property('BLOCK288.SAVE_IN_VAL2', ENABLED, property_false);
ElsIF DD.IN_VAL = 'NO' THEN
set_item_property('TEMP1.SAVE_IN_VAL', ENABLED, property_true);
set_item_property('BLOCK288.SAVE_IN_VAL', ENABLED, property_true);
set_item_property('TEMP1.SAVE_IN_VAL2', ENABLED, property_true);
set_item_property('BLOCK288.SAVE_IN_VAL2', ENABLED, property_true);
End if;

--Message(DD.IN_VAL);

next_record;

End loop;
End;

What I want to be check button to do, is if IN_VAL Column in form = YES then
disable in_val button, if in_val = NO then enable in_val Button ...It works if all data in_val is yes / no then all buttons are disabled / enabled.. but runnin into problems when I have yes and no values for in_val like on the screen shot I took

Top datablock is TEMP1 and bottom datablock is BLOCK288
Both point to table TEMP.
I have 4 seperate in_val buttons

TEMP1.SAVE_IN_VAL
TEMP1.SAVE_IN_VAL2
BLOCK288.SAVE_IN_VAL
BLOCK288.SAVE_IN_VAL2

Any suggestions

Thanks

Re: Problems w/ Form buttons [message #176466 is a reply to message #176304] Thu, 08 June 2006 07:02 Go to previous messageGo to next message
gacki
Messages: 33
Registered: May 2006
Location: Dueren, NRW, Germany
Member
The code does what you tell it to do: You loop through your table data (which has only two records), and in the last record IN_VAL has value 'YES' and therefore all your IN_VAL buttons are disabled.

IF DD.IN_VAL = 'YES' THEN
set_item_property('TEMP1.SAVE_IN_VAL',ENABLED, property_false);
set_item_property('TEMP1.SAVE_IN_VAL2',ENABLED,property_false);
set_item_property('BLOCK288.SAVE_IN_VAL',ENABLED,
property_false);
set_item_property('BLOCK288.SAVE_IN_VAL2', ENABLED, property_false);


I have no idea what your form should be able to. But why do you loop through your table when all you need is on the screen? And what happens in case the table contains more than two records?

Gerald
Re: Problems w/ Form buttons [message #176487 is a reply to message #176304] Thu, 08 June 2006 08:49 Go to previous messageGo to next message
sikorsky05
Messages: 40
Registered: October 2005
Member
I want to be able to enable the in_val button only if the value is No.. So then when user hit the in_val button it will add it to the in_val table.... If value is Yes then that means it's in the Val table therefore disabling the button since I wouldn't want to add it ...

Data in the tables only have max 2 records... if there is more then data in not correct... How can I fix this problem that I am having...
Re: Problems w/ Form buttons [message #176627 is a reply to message #176487] Fri, 09 June 2006 00:27 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please remove your mind set of having to run a manual cursor. Please start thinking about using the Oracle Forms block and its implied cursor and apply your logic to the block (cursor) that has been retrieved.

To change an item on a row use the 'Set_Item_Instance_Property' and do it in the Post-Query trigger. This fires for each row as it is retrieved.

David
Previous Topic: SOS - convert/rev-engineering FMX to FMB
Next Topic: form on table index organazied Error
Goto Forum:
  


Current Time: Fri Sep 20 07:36:50 CDT 2024