Skip to Content
author's profile photo Former Member
Former Member

cl_htmlb_manager=>get_data( )

Hello,

this is a question regarding the class <i>cl_htmlb_manager</i>. I'd like to get at (the value of) the selection attribute of a radiobutton group after some button has been clicked. I use code like this in the event handler of a controller

...
CONCATENATE me->component_id '_2' INTO rbg_id.

radiobuttongroup ?= cl_htmlb_manager=>get_data(
                          request   = me->request
                          name      = 'radioButtonGroup'
                          id        = rbg_id ).

IF radiobuttongroup IS BOUND.
  selection = radiobuttongroup->selection.
  ...
ENDIF.

Now, I am pretty sure the ID I am using is the ID of an existing radiobuttongroup object. The strange thing is <i>get_data( )</i> returns a radiobuttongroup object, but it is not the one I am expecting. Even if one uses some bogus ID that sure doesn't exist <i>get_data()</i> returns a (real, non-null) object?! That is <i>radiobuttongroup IS BOUND</i> is always true. So I have two main questions:

1) What could be the reason for <i>cl_htmlb_manager=>get_data()</i> behaving like this, i.e. why does it return an (apparently newly instantiated) object in case it doesn't find an object with the ID provided, what would be the use of this new object?

2) Is there any way to find out which (radionbutton group-) objects exist at some point in time? I'd like to check whether the ID I'm using is really correct.

Regards,

Sebastian

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 20, 2004 at 08:34 AM

    What does your <htmlb:radionButtonGroup look like on your Page layout?

    I always use:

    radiobuttongroup ?= cl_htmlb_manager=>get_data(
                              request   = me->request
                              name      = 'radioButtonGroup'
                              id        = 'myRadioGroup' ).
    
    IF radiobuttongroup IS NOT INITIAL.  
       selection = radiobuttongroup->selection.  
       .....
    ENDIF.
    

    I always give it the exact name of the radioButtonGroup that I defined on my Page Layout. I'll play around and try to see if I get the same thing you are seeing, perhaps you found a bug/feature type of thing. Maybe Brian will have some thoughts on it when he logs in.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Daniel Humberg

      Hi Daniel,

      sorry for my belated answer, I was on vacation for a while.

      However, I didn't solve the problem back then and eventually went along with Suresh's proposal and used form fields instead. So the actual question is still open.

      Regards,

      Sebastian

  • author's profile photo Former Member
    Former Member
    Posted on Dec 11, 2004 at 12:24 AM

    Hi Sebestian,

    After seeing your code what i found is ID should be inside single quotes ''.

    radiobuttongroup ?= cl_htmlb_manager=>get_data(

    request = me->request

    name = 'radioButtonGroup'

    id = rbg_id ).

    IF radiobuttongroup IS BOUND.

    selection = radiobuttongroup->selection.

    ...

    ENDIF.

    The code should be,

    radiobuttongroup ?= cl_htmlb_manager=>get_data(

    request = me->request

    name = 'radioButtonGroup'

    id = 'rbg_id' ).

    IF radiobuttongroup IS NOT INITIAL.

    selection = radiobuttongroup->selection.

    ...

    ENDIF.

    Did you try this. You will get the selected Radio button under your Radiobuttongroup 'rbg_id'.

    Hope this helps

    arun

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.