cancel
Showing results for 
Search instead for 
Did you mean: 

On click of a Radio button

Former Member
0 Kudos

Hi,

My requirement is as follows.

Sequence of events to happen.

Click of a radiobutton-> dropdown is made visible-> onclick of a value in dropdown-> simple text with selected value of dropdown is made to be visible.-> on click of above simple text-> table with some data is made visible.

At the final step i should be able to see all the selected events. it should not get reset.

that is i should be able to see the selected radio button,selected value of dropdown .

I need to achieve this functionality entirely in html.

How can i achieve this.

please help.

Thanks,

Sandeep.

Accepted Solutions (1)

Accepted Solutions (1)

former_member233090
Active Contributor
0 Kudos

Hi Sandeep,

are you working with html or htmlb? and one more thing are you using MVC concept or simply page with flow logic.

cheers ,

bhavana

Former Member
0 Kudos

am working with html and simple page with flow logic.

former_member233090
Active Contributor
0 Kudos

Ok ,

ok sandeep, i will tell you step by step and just follow it, hope it works out....

first thing is do you want any one radio button to be selected default?

second do you have a different dropdown button based on the selection of radio button?

Former Member
0 Kudos

no i dont want any radio button to be selected by default.

there are different dropdown s for different radio button s selected.

can i send you the code i implemented. i actually used htmlb for handling the event.but the problem is am getting radio buttons in a table. and i should be replicating this page with other pages of some application. so i should maintain the look and feel by using some style sheets.

can i send u the code to ur mail id.

thanks,

sandeep.

former_member233090
Active Contributor
0 Kudos

sure sandeep, you can send me the code.

if possible i will explain you with an example here , may be u are also looking for the same.

Former Member
0 Kudos

sure bhavana. Please run me through the example. i will try out if it can help me out.

Can u send the test mail to my id.(sandeep_reddym @ dell.com)

U may get more clarity on my requirement and if i have done any mistake in my code by looking at my code.

former_member233090
Active Contributor
0 Kudos

<%@page language="abap"%>
<%@page language="abap" forceEncode="html"%>
<%@extension name="htmlb" prefix="htmlb"%>
<%@extension name="bsp"   prefix="bsp"%>
former_member233090
Active Contributor
0 Kudos

in page attributes you have take

it_vbak type zvbak -


>change it to VBAK_T

it_vbap type zvbap-----> chage it to VBAP_T

Edited by: Bhavana Amar on May 24, 2010 8:46 AM

Former Member
0 Kudos

bhanvana i tried with your example , there i can see radio button and dropdown together at once. but i want only radio buttons to be visible and then on click of radio button i want dropdopwn to be visible with some values.

and on click of some value in dropdown i want some text to be displayed.

on click of that text i want table with some data to be displayed.

its sequential..

former_member233090
Active Contributor
0 Kudos

Ok

you can add a flag there, on input processing after the radio button code set some flag = 'X' and in the view before you display the dropdown put a if condition as <% if flag = 'X' then display the dropdown else not .

in attributes take flag type char01

2) when you select the dropdown there also you can set another flag say dropdownflag ='X' and same way you can code as

if that flag is 'X' you give the text field and similarly the table view,

hope you got it

Former Member
0 Kudos

oninput processing event is not getting trigerred..

former_member233090
Active Contributor
0 Kudos

Hi sandeep,

i tried debugging it is working fine, i have done some changes as per ur requirement check this out.


DATA: radioButtongroup TYPE REF TO CL_HTMLB_RADIOBUTTONGROUP.
   radioButtonGroup ?= CL_HTMLB_MANAGER=>GET_DATA(
                         request      = runtime->server->request
                         name         = 'radioButtonGroup'
                         id           = 'myRadioButtonGroup1' ).
 rdflag = 'X'.----------------------> add this for the visiblility
 
 DATA: data1 TYPE REF TO CL_HTMLB_DROPDOWNLISTBOX.
data1 ?= CL_HTMLB_MANAGER=>GET_DATA( request = runtime->server->request
                                      name    = 'dropdownlistbox'
                                      id      = 'mydropdownListBox1').
   selection1 = radioButtongroup->selection.
   drdwnflag = 'X'.--------------------->this too
   case selection1.

Edited by: Bhavana Amar on May 24, 2010 9:27 AM

former_member233090
Active Contributor
0 Kudos

after radio button display

   
    <% if rdflag = 'X'.%>      -------------------------------> added new     
      <htmlb:dropdownListBox    id          = "mydropdownListBox1" >
        <htmlb:listBoxItem      key         = "key_vbak" value = "vbak" />
        <htmlb:listBoxItem      key         = "key_vbap"  value = "vbap"  />    
        </htmlb:dropdownListBox>
<%  if it_vbak is not initial.%>
<htmlb:tableView id="tv_vbak" table="<%= it_vbak%>">
</htmlb:tableView>
<%endif.%>
<%  if it_vbap is not initial.%>
<htmlb:tableView id="tv_vbap" 
        table="<%= it_vbap%>">
</htmlb:tableView>
<%endif.%>
<%endif.%>
    </htmlb:form>

Former Member
0 Kudos

thanks bhavana my problem is solved.But can i achieve same using html.

because i need to use some stylesheets on these radio buttons.

Former Member
0 Kudos

how do i display a text and then on click of that text i need to display that table.

former_member233090
Active Contributor
0 Kudos

Sorry,

i have never tried with html but i can say we can do cascading in htmlb too

cheers,

bhavana

former_member233090
Active Contributor
0 Kudos

On select of dropdown take the textview field, so add the code where you have written code for dropdown.

suppose in ur view code is like this


<htmlb:gridLayoutCell rowIndex    = "1"
                           columnIndex = "1">
      <htmlb:textView text   = "Name"
                      design = "EMPHASIZED" />
       </htmlb:gridLayoutCell>
       <htmlb:gridLayoutCell rowIndex    = "1"
                             columnIndex = "2" >
        <htmlb:inputField id       = "i_name"
                          type     = "string"
                          size     = "10"
                          value    = "<%= i_name %>" />-----> in the dropdown code give the text what ever you want to .
       </htmlb:gridLayoutCell>

Former Member
0 Kudos

bhavana can you help me with this

here the function itself is not getting called.

The functionality i want to achieve here is on click of that text i need to display the table in the same page.

Pl help.

Thanks,

Sandeep

Answers (0)