Skip to Content

htmlb button/image fire server event and client event

Hi,

by pushing a button/image I want to navigate to another page using "onClick" and navigation->goto_page('nextpage.htm') which works fine with the onInputProcessing event handler.

Now, in addition I need to fire a Clientevent to call a javascript to refresh my side, from where I start to navigate which works also fine.

But it looks like only one of the to events are working.

I can either refresh my startpage (onClientClick) but then navigation to the next page will not work, or I can naviagte to the next page (onClick) but then refresh of startpage with Javascript will not work.

Any idears or hints are appreciated. Thx a lot and regards from

Michael

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Nov 25, 2005 at 10:07 PM

    The details here are sketchy, but one quick solution might be to do the following. Use the <bsp:htmlbEvent> element to generate a JavaScript that will trigger a server side event. Then only include the onClientClick event. Change the JavaScript that you already have in the onClientClick to call your htmlbEvent generated JavaScript at the end. That way you should be able to finish whatever client side activities you need to do before you call the server event (and then your navigation).

    Add a comment
    10|10000 characters needed characters exceeded

    • both onClientClick and onClick should work for button or image. to isolate the problem may be try to run the following application and if it works and the same dosent work in your application, there may be somethingelse wrong.

      sample application.

      <u><b>page attribute:</b></u>

      eventstring type string .

      <u><b>layout:</b></u>

      <%@page language="abap" %>

      <%@extension name="htmlb" prefix="htmlb" %>

      <htmlb:content design="design2003" >

      <htmlb:page title=" " >

      <htmlb:form>

      <htmlb:button text = "Press Me"

      onClick = "mybutton"

      onClientClick = "javascript:alert('test');" />

      <br>

      <htmlb:image src = "ICON_EXECUTE_OBJECT"

      onClick = "myimage"

      onClientClick = "javascript:alert('test');" />

      <br>

      <%= eventstring %>

      </htmlb:form>

      </htmlb:page>

      </htmlb:content>

      <u><b>oninputprocessing.</b></u>

      data: event type ref to cl_htmlb_event.

      event = cl_htmlb_manager=>get_event( runtime->server->request ).

      clear eventstring .

      if not event is initial .

      move: event->SERVER_EVENT to eventstring .

      endif .

      Check this and let us know.

      Regards

      Raja

  • Posted on Nov 28, 2005 at 06:30 PM

    Thank you,

    I will have time to investigate this in more detail later on this week. It might be possible that it has also to do with the design of the application, because we use frames and are calling pages in the frames.

    because of frames and javascript can leed to browser specific results, we decided most likely to change whole design of application, because later on this will be an extranet application.

    thank you again and regards from Michael

    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.