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

Button Handling Question - Time Critical

We have several screen's that execute BAPI calls to CRM to update data. When a user clicks an "Update" button, I would like a way to set that button to disabled until the operation completes. I was thinking that we could use the setOnClientClick method to add JavaScript that would set disabled=true. As it turns out, this does not work because the Button class actually seems to represent an HTML anchor, not an actual button. I tried doing a call in the method that handles the update to get the button component by name and set.Enabled(false). This did not work because I can not force a screen redraw. Any help would be greatly appreciated. This question is VERY high priority for us and we are running out of time to find a solution.

To be complete - we are running EP6 SP2. All of our development is based on Java DynPages (no JSP) and HTMLB.

-Matt

Message was edited by: Matthew Allen

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 11, 2004 at 07:08 AM

    You could try to hack it 😊

    Add a new button which is set to enabled in an invisble div on the same places as the first. Placee the old button also in a div which is visible

    Then when the button is clicked, swap visibility.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2004 at 12:49 PM

    The following code shows how to use client side scripting with HTMLB in order to avoid subsequent "submits" of a form by clicking a button more than once.

    It does so by setting a flag after a button was clicked. On each subsequent click the script checks whether or not the form was already submitted and cancels the submit accordingly. In contrast to disabling a button this solution has the benefit that one can avoid the submit of this form from any other control as well (e.g. by another button) since the flag can be checked from everywhere.

    HTMLFragment html = new HTMLFragment("<script>var xxxSubmit=true;</script>");

    myForm.addComponent(html);

    Button myButton = new Button("myButton", "click me!");

    myButton.setOnClick("onButtonClick");

    myButton.setOnClientClick(

    "if(xxxSubmit==true)

    {

    xxxSubmit=false;

    return true;

    }

    else

    {

    htmlbevent.cancelSubmit=true;

    return false;}

    ");

    myForm.addComponent(myButton);

    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.