This discussion is archived
3 Replies Latest reply: Apr 3, 2013 10:11 PM by HamidHelal RSS

Radio buttons in Forms

LuKKa Newbie
Currently Being Moderated
Hi All
I am facing a silly error in Radio button .
I have a radio group and inside that I have 2 radio buttons.
I have One display item and one button .
I want when Radio button 1 is selected the in Display item some message should display else other message should display .
This will happen when I press the push button .

So I have written in WHEN_BUTTON_PRESSED trigger as below .


If :ITEM4.RADIO_BUTTON5 = 1 then
     :ITEM9 := 'Radio1';
Else
     :ITEM9 := 'Radio2';
End if ;



But I am getting this error .
Can you please tell me what is the problem .

BLOCK3 -- Block
ITEM4 -- Radio Group
RADIO_BUTTON5 - Radio Button 1
RADIO_BUTTON6 - Radio Button 2

ITEM9 - Display item

ITEM8 - Push Button
  • 1. Re: Radio buttons in Forms
    LuKKa Newbie
    Currently Being Moderated
    Hi All
    I think I need to write like this :-

    Instead of Radio group name . Radio button name I need to take BLOCK name . RADIO GROUP NAME

    IF BLOCK3.ITEM4 = 1 then
    Do something
    ELSE
    DO Something .
    End if .

    Is it correct ?
  • 2. Re: Radio buttons in Forms
    HamidHelal Guru
    Currently Being Moderated
    LuKKa wrote:
    Hi All
    I am facing a silly error in Radio button .
    I have a radio group and inside that I have 2 radio buttons.
    I have One display item and one button .
    I want when Radio button 1 is selected the in Display item some message should display else other message should display .
    This will happen when I press the push button .

    So I have written in WHEN_BUTTON_PRESSED trigger as below .


    If :ITEM4.RADIO_BUTTON5 = 1 then
         :ITEM9 := 'Radio1';
    Else
         :ITEM9 := 'Radio2';
    End if ;



    But I am getting this error .
    Can you please tell me what is the problem .

    BLOCK3 -- Block
    ITEM4 -- Radio Group
    RADIO_BUTTON5 - Radio Button 1
    RADIO_BUTTON6 - Radio Button 2

    ITEM9 - Display item

    ITEM8 - Push Button
    Why there is Need of button to display message, i don't know. The task can accomplish by simply clicking the radio button instantly. If you agree with me then try this. Create a WHEN-RADIO-CHANGED trigger under radio group. You need to set unique RADIO BUTTON VALUE in each radio button.
    /* WHEN-RADIO-CHANGED sample code assuming your button value is 1 and 2 */
    IF :BLOCK3.ITEM4 = 1 THEN
     :ITEM9 := 'Radio1';
    ELSIF :BLOCK3.ITEM4 = 2 THEN
     :ITEM9 := 'Radio2';
    END IF;
    You can try this code also in your When-Button-Press trigger.


    Hope this helps


    Hamid


    If someone's response is helpful or correct, please mark it accordingly.*
  • 3. Re: Radio buttons in Forms
    LuKKa Newbie
    Currently Being Moderated
    Yes you are right .
    The example which I gave that is just an example .
    But in real scenario I have to something in Buttome pressed , So i asked .
    Thank you very much for you reply .

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points