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!
Thanks,
Manny