cancel
Showing results for 
Search instead for 
Did you mean: 

BSP code - radiobutton - search button

Former Member
0 Kudos
222

Hello BSP gurus,

Ok, so far I have this piece of code. The idea is to click on a radiobutton and then click on the search button in order to go to the next screen (the result screen).

Does anyone have an idea how to handle this?

Thanks in advance.

<htmlb:radioButton id = "rad1"

key = "r1"

disabled = "false"

text = "Report 1"

checked = "false"

/>

<htmlb:button id = "search"

text = "Search"

onClick = "onInputProcessing(select)" />

View Entire Topic
raja_thangamani
Active Contributor
0 Kudos

In Layout:

<htmlb:radioButton id = "rad1"
key = "r1"
text = "Report 1"
checked = "false"
  />

<htmlb:button id = "search"
text = "Search"
onClick = "selec" />

<b>OnInputprocessing Event:</b>

DATA EVENT TYPE REF TO CL_HTMLB_EVENT.

IF NOT EVENT_ID IS INITIAL.

  EVENT ?= CL_HTMLB_MANAGER=>GET_EVENT_EX( REQUEST ).

  IF NOT EVENT IS INITIAL.

    CASE EVENT->SERVER_EVENT.

      WHEN 'select'.
       navigation->goto_page( 'result_page.htm').
    ENDCASE.
  ENDIF.
ENDIF.

<i>* Reward each useful answer</i>

Raja T

Former Member
0 Kudos

Thanks very much, your answer solved my problem. However, do you know how can I do this with multiple radiobuttons. I explain. Let's say I have 3 radiobuttons and each one needs to send you to different screen (reports in this case). How do I implement the calling of the reports?

Ol.

raja_thangamani
Active Contributor
0 Kudos

Here you go..

<b>To display more than 1 Radiobutton:</b>

    <htmlb:radioButtonGroup id          = "grp1"
                               columnCount = "4"
                               disabled    = "false"
                               mode        = "LAYOUT_GROUPING"
                               selection   = "<%= selected %>"
                               tooltip     = "This is my RadioButton Group"
                               width       = "500" >
        <htmlb:radioButton id      = "rad1"
                            key     = "r1"
                            tooltip = "This is a radio button1"
                            text    = "search1"
 />
        <htmlb:radioButton id      = "rad2"
                            key     = "r2"
                            tooltip = "This is a radio button2"
                            text    = "search2"
                            checked = "true"
                            onClick = "click2" />
      </htmlb:radioButtonGroup>

<b>To capture selected Radiobutton:</b>



  DATA: rbg       TYPE REF TO CL_HTMLB_RADIOBUTTONGROUP.
              rbg ?= CL_HTMLB_MANAGER=>GET_DATA( request = request id = 'grp1' name = 'grp1' ).

if rbg is not initial.
selected = rbg->selection.
 if selected = 'r1'.
   navigation->goto_page( 'result_page1.htm');
 elseif selected = 'r2'.
  navigation->goto_page( 'result_page2.htm');
 endif.
endif.

Raja T

<b>* Reward each useful answer</b>

Former Member
0 Kudos

Hello Raja,

I haven't touched this for a while... I hope you can still help me out with it.

I'm still confused with this piece of code:

if rbg is not initial.

selected = rbg->selection.

what is selected? and how do I declare it? Please advise.

Ol.

Former Member
0 Kudos

Hi Ol,

You can declare selected in your page attributes tab.

Try declaring it as selected type string.

This should work.

<b><i>Do reward each useful answer..!</i></b>

Thanks,

Tatvagna.

Former Member
0 Kudos

I tried that, but I get a BSP error.

also, the code after " if rbg is not initial. " never runs... (since it is initial)

Former Member
0 Kudos

Hi,

In Raja's code

 DATA: rbg       TYPE REF TO CL_HTMLB_RADIOBUTTONGROUP.
              rbg ?= CL_HTMLB_MANAGER=>GET_DATA( request = request id = 'grp1' name = 'grp1' ).

Change value of attribute name to <b>radiobuttongroup</b> instead of <b>grp1</b>.

Also remove <b>;</b> after

<b> navigation->goto_page( 'result_page1.htm');</b>

and change it to a simple period.

Hope this helps.

<b><i>Do reward each useful answer..!</i></b>

Thanks,

Tatvagna.

Message was edited by:

Tatvagna Shah

Former Member
0 Kudos

i'm sorry but one more thing...

the selected field is empty in debug mode...

why is that?

Former Member
0 Kudos

Well thats strange...

The same code works for me...!!

Hope this helps.

<b><i>Do reward each useful answer..!</i></b>

Thanks,

Tatvagna.

Former Member
0 Kudos

Hi Ol,

Just one question...

have you changed the radio button group id in your code...??

If yes then you need to make the change in onInputProcessing...??

Hope this helps.

<b><i>Do reward each useful answer..!</i></b>

Thanks,

Tatvagna.

Former Member
0 Kudos

thanks a lot! it worked!!!

Former Member
0 Kudos

HI,

Its not working for mw ...I am getting selected as blank.....please help.