Home » Developer & Programmer » Forms » Radio Button Problem please help
icon4.gif  Radio Button Problem please help [message #239960] Wed, 23 May 2007 14:12 Go to next message
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 #240322 is a reply to message #239960] Thu, 24 May 2007 10:54 Go to previous messageGo to next message
kornflakes
Messages: 14
Registered: May 2007
Junior Member
So, anyone can help me, i need a solution for this problem.

Pls
Re: Radio Button Problem please help [message #240425 is a reply to message #240322] Thu, 24 May 2007 16:21 Go to previous messageGo to next message
Basit
Messages: 38
Registered: April 2007
Member

hello cornflake,

try to set the (Mapping of Other Values(property in PROPERTY PALLETE) set it to the one of INITIAL VALUE, i can suggest you this. try this and let me know what happens

Re: Radio Button Problem please help [message #240437 is a reply to message #239960] Thu, 24 May 2007 18:33 Go to previous messageGo to next message
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 #240968 is a reply to message #240437] Mon, 28 May 2007 02:03 Go to previous messageGo to next message
mustaf_82
Messages: 20
Registered: May 2007
Location: UAE
Junior Member

Do you open the form in query mode ??
I mean are you running execute_query when form opens?
Re: Radio Button Problem please help [message #241022 is a reply to message #239960] Mon, 28 May 2007 03:59 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

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 Go to previous messageGo to next message
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 #241209 is a reply to message #239960] Mon, 28 May 2007 19:53 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

Check your code on when-radio-changed trigger, I suspect there's something there reverting what you have done.
Re: Radio Button Problem please help [message #241241 is a reply to message #241198] Mon, 28 May 2007 23:51 Go to previous messageGo to next message
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 Go to previous message
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

Previous Topic: Documentation of Summit Office Supply (merged)
Next Topic: i need help
Goto Forum:
  


Current Time: Thu Dec 08 20:19:00 CST 2016

Total time taken to generate the page: 0.08407 seconds