Radio Button Problem please help [message #239960] |
Wed, 23 May 2007 14:12 |
kornflakes
Messages: 14 Registered: May 2007
|
Junior Member |
|
|
Can anybody help me please.
Here's my radio problem
I made a form with developer 2000, i have some text item, and 3 radio button on a radio group name STATUS, this radio group (STATUS) is a database item, in order to send the value of the radio to a db table.
Radio values:
Radio_1 = 'C'
Radio_2 = 'A'
Radio_3 = 'M'
Radio Group initial value = 'M'
I can send the value to the database, but if i query the table i need the correct radio to be checked, and is not happening, and the radio with the initial value gets checked.
The weird thing is that if i put two MESSAGE on post query trigger, or if i move to a next record and then back to previous record the correct radio gets checked, i think is something about refresh the form or something like that.
Is there a trigger thats execute only when the whole block was query or an option to get the right radio checked?
Thanks in advance and i hope you understand my poor english
[Updated on: Wed, 23 May 2007 18:56] Report message to a moderator
|
|
|
|
|
Re: Radio Button Problem please help [message #240437 is a reply to message #239960] |
Thu, 24 May 2007 18:33 |
kornflakes
Messages: 14 Registered: May 2007
|
Junior Member |
|
|
hi basit,
Im sorry to tell you but it didn't solve the problem.
The problem is that i have 3 radios with C,A,M values each one, and they are synchronize with STATUS (a database item with initial value set to M) if i query the database and get a C on STATUS i need the radio button with the value C get checked but it doesn't, instead i get the radio with value M checked (initial value of STATUS).
I noticed that this only happens with the first record when the form first open. When i move to a next record and then come back to first record the radio with value C (the one that has to be checked) get checked.
Who knows how to solve the problem.
Because of my desperation i've been thinking of chance that radio for a list item i guess is not the best solution but...
Thanks again
|
|
|
|
Re: Radio Button Problem please help [message #241022 is a reply to message #239960] |
Mon, 28 May 2007 03:59 |
|
It always happened, I don't know why. I don't bother to research. I just put my code on post query to solve it.
FOR rec IN (SELECT STATUS
FROM table
WHERE <ur condition>)
LOOP
v_STATUS := rec.STATUS;
END LOOP;
IF nvl(v_STATUS, ' ') IS NULL THEN
:blk.STATUS := 'M'; --initial value
ELSE
:blk.STATUS := nvl(v_STATUS, 'M');
END IF;
|
|
|
Re: Radio Button Problem please help [message #241198 is a reply to message #239960] |
Mon, 28 May 2007 15:17 |
kornflakes
Messages: 14 Registered: May 2007
|
Junior Member |
|
|
mustaf Yes i execute_query on a when new form instance trigger
wency, i tried with your code but it's just giving me the same thing.
If i put this on the post-query trigger
:block.STATUS := 'C';
IF :SYSTEM.FORM_STATUS = 'CHANGED' THEN
SET_RECORD_PROPERTY (GET_BLOCK_PROPERTY('block',CURRENT_RECORD),'block',STATUS,QUERY_STATUS);
END IF; --no save change message
The radio value 'M' get's checked (initial value)
why?, i just put 'C' on STATUS isn't it.
I just don't understand, or is just that i can't assign the value to a radio on a post_query trigger?.
Thanks in advance
[Updated on: Mon, 28 May 2007 15:30] Report message to a moderator
|
|
|
|
Re: Radio Button Problem please help [message #241241 is a reply to message #241198] |
Mon, 28 May 2007 23:51 |
mustaf_82
Messages: 20 Registered: May 2007 Location: UAE
|
Junior Member |
|
|
Check the Database Column Property of this radio group.
If the value is set to NO then it will set as initial value whenever you will open the form. Set the DATABASE COLUMN VALUE to "YES".
I am sure it will work.
|
|
|
Re: Radio Button Problem please help [message #241475 is a reply to message #239960] |
Tue, 29 May 2007 14:14 |
kornflakes
Messages: 14 Registered: May 2007
|
Junior Member |
|
|
Ok, after using almost all the triggers forms has, i found the one that solve the problem, it's call WHEN-WINDOW-ACTIVATED, with the next code
IF :FLAG = 0 THEN
GO_BLOCK('BLOCK');
EXECUTE_QUERY;
:FLAG := 1;
END IF;
So, when the form just open and when the window is activated i execute the query and turn on the flag in order to prevent more than once execute.
Hope is useful for anybody with the same problem.
By the way, how was my english (bad,medium,good)
Thanks
[Updated on: Tue, 29 May 2007 14:19] Report message to a moderator
|
|
|