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

handling onClick() on server side

Hi

In my main page I have kept a htmlb button as

<code>

<i> <htmlb:button text="Submit" onClick="submit_employee"

onClientClick = "showMessage()"/></i>

</code>

in my OnInputProcessing() I have this code to catch the event and show different pages accordingly.

<code>

<i>DATA: event TYPE REF TO CL_HTMLB_EVENT.

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

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

DATA: button_event TYPE REF TO CL_HTMLB_EVENT_BUTTON.

button_event ?= event.

ENDIF.

CASE event->id.

WHEN 'submit_employee'.

navigation->goto_page('showData.htm?source=default.htm').

WHEN 'get_employee'.

navigation->goto_page('default.htm?inputError=yes').

WHEN others.

navigation->goto_page('genericError.htm').

ENDCASE.</i>

</code>

I could not understand why it is not going to 'showData.htm' page. always it goes to 'genericError.htm' when the button clicked.

please help.

Thanks & reagrds

Ashutosh

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 08, 2005 at 10:17 AM

    Put a break point in and see what the value of event->id, there you will notice that the event->id is not "submit_employee"

    Take a look at the example SBSPEXT_HTMLB for the htmlb:button and you will see how to get the value.

              <table border="1px" cellpadding="1px" cellspacing="0px" style="font:normal 10pt Arial">
                <tr> <td>Event-Class</td>              <td><%=event->event_class %>                  </td> </tr>
                <tr> <td>Event-ID</td>                 <td><%=event->event_id %>                     </td> </tr>
                <tr> <td>Event-Name</td>               <td><%=event->event_name %>                   </td> </tr>
                <tr> <td>Event-Type</td>               <td><%=event->event_type %>                   </td> </tr>
                <tr> <td>Event-Server Name</td>        <td><%=event->event_server_name %>            </td> </tr>
                <tr> <td>Event-Defined</td>            <td><%=event->event_defined %>                </td> </tr>
              </table>
    

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 08, 2005 at 10:19 AM

    Try

    case button_event->SERVER_EVENT.

    instead of

    case event->id.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Thomas. it worked as you told.

      now I am facing some problem in transfering data through page attributes. In my first page i have some htmlb inputfields, and I have page attributes having same name as that of inputfield id. On another page which is being displayed after clicking a submit button (about which I have described above) I have definded same page attributes as that of first. Now as far as I know if attributes are auto type for a statefull BSP app the attribute values should automatically copied to second page. but I am not geting the values on second page.

      sorry for the long desciption.

      regards

      Ashutosh

  • Posted on Feb 08, 2005 at 11:43 AM

    Hi Ashutosh ,

    May i Request you to spend sometime to read the below given weblog.

    /people/mark.finnern/blog/2004/08/10/spread-the-love

    Regards

    Raja

    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.