cancel
Showing results for 
Search instead for 
Did you mean: 

reb button cllick

Former Member
0 Kudos

Hi all,

I have coded for getting a link on my screen as follows

<htmlb:link id = "<%= ls_appl_desc-application %>"

text = "<%= lv_desc %>"

reference = "<%= lv_url %>" />

Now I want to have this as a button.

How can i do this?

Thanks and Regards,

Sneha.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183924
Active Participant
0 Kudos

Hi Sneha,

why don't you take the button tag from the htmlb-extension?

like this:


  <htmlb:button id            = "bt_id01"
                text          = "<%= lv_desc %>"
                onClick       = "onacceptclick" />

now you can pass this button in the eventhandler "OnInputProcessing" with this code:


CLASS CL_HTMLB_MANAGER DEFINITION LOAD.

DATA: event TYPE REF TO CL_HTMLB_EVENT.
event = CL_HTMLB_MANAGER=>get_event( runtime->server->request ).

CASE event->name.
WHEN 'button'.
  IF event->id = 'bt_id01.
     <do what you want>.
  ENDIF.
WHEN OTHERS.
ENDCASE.

Former Member
0 Kudos

Hi,

I have written a code in which i need to open a link. so i have written code accordingly for the link. But now i need to open this link on button click. At this point i cant change my code for button again. what i can do is only i can change in layout part, put a button instead of link and open the same link.How can i do this?

Thanks and Regards,

Sneha.

Former Member
0 Kudos

Hi puppla,

use the following code...



<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>
<script type="text/javascript">

          function lik() {
          window.open('http://www.sap.com');
          }

          </script>

<htmlb:content design="design2003">
  <htmlb:page title = "link">
    <htmlb:form>

      <a href="http://www.sap.com"> text click </a>

      <htmlb:button  text          = "Button click"
                    onClientClick = "javascript:lik();" />
                          
     </htmlb:form>
  </htmlb:page>
</htmlb:content>

Rgds,

Jothi.P

Award pts and close the thread if useful.

Former Member
0 Kudos

Hi Jyothi,

Thanks for the code.its working now.

Regards,

Sneha.

Answers (0)