cancel
Showing results for 
Search instead for 
Did you mean: 

Checkbox and button

Former Member
0 Kudos

Hi forum!

I have a little problem with a checkbox and a button..

I want to do queries when i click on a button, a query A when the checkbox is not checked and a query B when the checkbox is checked.

Well, on the layout:

         <htmlb:checkboxGroup id="myCheck" columnCount="1" >
                     
         <htmlb:checkbox id        = "cb1"
                         text      = "Checkbox without nested elements"
                         tooltip   = "Click the checkbox, clicking thetext does not work"
                         checked   = "<%=checked%>"   >
         </htmlb:checkbox>                
                         
         </htmlb:checkboxGroup>  


       <htmlb:button       id            = "boton"
                           text          = "Realizar consulta"
                           tooltip       = "Pulse para comenzar la busqueda"
                           onClick       = "oninputprocessing()"
                           design        = "emphasized"></htmlb:button>

But OnInputProcessing, i have to know if the checkbox is checked..

DATA: event  TYPE REF TO cl_htmlb_event,
      button_event TYPE REF TO cl_htmlb_event_button,
      chkbox1 type ref to cl_htmlb_checkbox.

 event ?= cl_htmlb_manager=>get_event( runtime->server->request ).
 
 chkbox1 ?= CL_HTMLB_MANAGER=>GET_DATA(
request = runtime->server->request
name = 'checkbox'
id = 'cb1' ).

  IF event->name = 'button' AND event->event_type = 'click'.
    button_event ?= event.

   CASE button_event->id.

    WHEN 'boton'.
*
* I now how to know if the checkbox is really checked¿?¿?
*
.
.
.
.
.
endIF.

Thanks and regards!!

Mon

Accepted Solutions (1)

Accepted Solutions (1)

daniel_humberg
Contributor
0 Kudos

Try this:


  IF event->name = 'button' AND event->event_type = 'click'.
    button_event ?= event.
 
   CASE button_event->id.
 
    WHEN 'boton'.

  IF chkbox1->checked = 'TRUE'.
*   bla
  ELSE
*   blabla
  ENDIF.
endIF.

Former Member
0 Kudos

Hello Daniel!!

Finally is:

IF chkbox1->checked = 'X'.

So thanks indded..i want to give you the points but i dont know what 's going wrong in the portal that i cant..i will try at home

Mon

Message was edited by: Mon

Answers (1)

Answers (1)

Former Member
0 Kudos

solved