2 Replies Latest reply on Jul 22, 2008 3:01 PM by 421144

    How to capture the Name / Label of a radio button in a variable

    421144
      Hi all,

      Can any of you tell me how to get this below done ?

      I have two radio buttons; I have declared a variable of type varchar2(20). how do i capture the name or label of these radio buttons in to my variable ? can the same technique be applied for other controls like text box, check box etc...

      Thanks in advance
      Shyam
        • 1. Re: How to capture the Name / Label of a radio button in a variable
          622936
          hi shyam
          If this issue is the same requirment like the prevouse post from you then review the answer agian.
          -------
          Regarding to your requirments
          you may use the following code in WHWN-RADIO-CHANGED at rg_color [radio group item]
          ------
          IF (:RG_COLOR='0') THEN
          :TEXT_COLOR:=null;
          SET_ITEM_PROPERTY('TEXT_COLOR',BACKGROUND_COLOR,'gray20');
          SET_ITEM_PROPERTY('TEXT_COLOR',FOREGROUND_COLOR ,'r100g0b0');
          ELSIF (:RG_COLOR='1') THEN
          :TEXT_COLOR:='RED';
          SET_ITEM_PROPERTY('TEXT_COLOR',BACKGROUND_COLOR,'r88g25b0');
          SET_ITEM_PROPERTY('TEXT_COLOR',FOREGROUND_COLOR ,'r100g0b0');
          ELSIF (:RG_COLOR='2') THEN
          :TEXT_COLOR:='BLUE';
          SET_ITEM_PROPERTY('TEXT_COLOR',BACKGROUND_COLOR,'r0g25b75');
          SET_ITEM_PROPERTY('TEXT_COLOR',FOREGROUND_COLOR ,'r100g0b0');
          ELSIF (:RG_COLOR='3') THEN
          :TEXT_COLOR:='GREEN';
          SET_ITEM_PROPERTY('TEXT_COLOR',BACKGROUND_COLOR,'r25g75b0');
          SET_ITEM_PROPERTY('TEXT_COLOR',FOREGROUND_COLOR ,'r100g0b0');
          END IF;

          ------------------------
          This sample of code can show at the text_color item what is required in addition to color the background and forground of the item.
          there is an additional radio_button added in order to distinguish between intinail_value and what appear in the text_color item
          if you like to send you the [fmb] file let me know

          Regards
          Omar
          • 2. Re: How to capture the Name / Label of a radio button in a variable
            421144
            Hi Omar,

            The intention was to resolve my previous requirement and it is resolved now; how ever I am curious to capture the control' property in a variable.

            Example:

            I have a push button named 'pb_view' whose label is 'View'

            I have two variables
            v_ctrl_name varchar2(15)
            v_ctrl_label varchar2(15)

            I would like to capture
            'pb_view' in v_ctrl_name and
            'View' in v_ctrl_label

            It would be great if you could throw some light on it.

            regards
            Shyam