Skip to Content
author's profile photo Former Member
Former Member

HTMLB Button Control Not Initiating OnInputProcessing

I am creating a BSP with an htmlb button element. I fully expect to land in the OnInputProcessing event handler when I press the button, but I do not. I also do not land in this event in any of the sample BSP's (i.e. HTMLB_SAMPLES, SBSPEXT_HTMLB). Rather, I get only a "javascript:void(0)" message. Or, I get an error message of "Object expected".

Conversely, if I set "submitonEnter" to "TRUE" for an input field, I land in OnInputProcessing. I've proven this in debug mode. I've also been able to place an image that can be clicked to initiate OnInputProcessing.

How can I land in OnInputProcessing when pressing an htmlb button? Also, the help text (perhaps for someone who knows nothing about web programming like me) is not very helpful regarding the OnClick property of a button. Can you shed some light on that?

I've received an initial response (thanks, Brian), below.


Now let us look at the button code. You effectively have three permutations you can write, and their meanings. Here "..." is for the id, text, tooltip etc parameters.

(1) <htmlb:button ... onClick = "myHandler" />

This onClick here is just a symbolic string. It means you are interested in the event of the button at the server. The myHandler is a string you can use to dispatch events somewhere, etc. (Sending events to server is just a submit of the HTML form.)

(2) <htmlb:button ... onClientClick = "alert('Hit me more!');" />

In this case no onClick handler is set. Thus no event is required at the server. When the user clicks the button, the onClientClick string is executed in the browser. This must be JavaScript code.

(3) <htmlb:button ... onClick = "myHandler" onClick="alert('Hang 10, we going to roundtrip')" />

This does both of the above. First execute the Javascript, and then send the event to the server (if not canceled).

(4) <htmlb:button ... />

This button has no events, and it will not help to be pressed. So effectively we render this button as disabled.

I would seriously recommend that you play with our test BSP applications. They all use buttons. See BSP applications: HTMLB_SAMPLES, SBSPEXT_HTMLB, SBSPEXT_XHTMLB and SBSPEXT_PHTMLB (>sp30).


But, from this response, I still do not know how to land in OnInputProcessing. Furthermore, adding the onClientClick phrase from number 2 above did not do anything in my test.

Further help would be much appreciated!



Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Nov 10, 2003 at 06:56 PM

    Hallo Manny,

    Nice to make a new thread, but more recommended would have reading the text. Point 2 would not help you at all. I explicitly wrote that for onClientClick NO (in uppercase!) event is send to the server. It is handled in the browser!

    Now let me make two remarks, and then I think that you should invest another hour.

    (1) Did you try any of our examples? I listed them above. Do the simple test of making a copy of SBSPEXT_HTMLB/button.bsp, and delete everything to the minimum until it works?

    (2) Try to write a five line test program to show it work or not work. If you post the code here, we would of course do the review for you. We don't spare in comments!

    So I now did (1) and (2) above and have:

    <%@page language="abap"%>

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




    <htmlb:button id = "myButton"

    text = "HitMe!"

    onClick = "myButtonClick" />




    Of course this worked immediately (see the onClick!), and I landed in the onInputProcessing method.

    Now let me place a guess to your 5 lines of code (which we have not seen yet). I suspect one of two errors:

    (1) You do not have the <htmlb:form> tag?

    (2) You have it, plus you defined an action to point onto another page.

    (3) Everything is actually working correctly, and you are just not landing in the debugger (there are many reasons for this).

    I will tip to (1) until proven otherwise.

    Now, you did play with our examples?

    bye, brian

    Add a comment
    10|10000 characters needed characters exceeded

    • Hallo Manny,

      Hmm...., we go from "Brian" to "Mr. McKellar". Now this is serious. Of course I take everything you said very seriously. New let me reread the whole thread quickly.

      Hmm...actually you wrote: "I also do not land in this event in any of the sample BSP's (i.e. HTMLB_SAMPLES, SBSPEXT_HTMLB). .... Or, I get an error message Object expected".

      I think I must first go outside and kick myself. ..... after 5 minutes he returns with very blue backside.

      Yes, Manny, you are 100% correct, and I have made a boo-boo here of unacceptable nature. Please accept my apologies. You are right that you actually did from the beginning write the small clue I was searching for. I should have been more careful in reading your problem first, before jumping to conclusions. It is my usual nature to actually read and reread posts before answering. In this case I am offside. On your next question, on any topic, I will spend the extra time to answer it correctly. I owe you that.

      As for the problem: You are correct. Once I knew that our stuff is not working I would have recommended checking OSS note 517484. I have nearly forgotten about this, as we added code in later SPs (about SP24) to explicitly check during runtime for all ICF nodes that we require, and to issue a warning if this problem is detected. So it does not happen often anymore.

      Also look at OSS note 616900. In the tab called attachments there is a FAQ document which references most of these types of problems that we have encountered in the past.

      I looked at your program. Two small minor comments: I would not worry about the classic design anymore. It is getting old and not used anymore. Change to design="design2002". Also, I am not sure if the "&nbsp&nbsp" strings we see above is in your program, or in SDN conversion of text. In anycase, it should be: " ".

      bye, brian (still feeling very stupid)

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.