Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Exception in firefox and safari

    We are using smartgwt and smartclient version 12.0.p. The following code snippet generates an exception in firefox while pressing button2 that will disble button1


    Button button1 = new Button("Button1") {
    @Override
    public String getInnerHTML() {
    return "Test";
    }
    };

    Button button2 = new Button("Button2");
    button2.addClickHandler(new ClickHandler() {

    @Override
    public void onClick(ClickEvent event) {
    button1.disable();
    }
    });
    Attached Files
    Last edited by mashiur; 24 Jul 2018, 07:02.

    #2
    Hi,

    shouldn't button1 be final in this case?

    Best regards
    Blama

    Comment


      #3
      But it has nothing to do with the exception

      Comment


        #4
        Why are you overriding getInnerHTML()? That replaces the button's HTML in the DOM - you probably want to setTitle() on it instead?

        Comment


          #5
          Just to confirm - this is incorrect usage and would be expected to break. You can’t simply replace the entire interior DOM structure of a button or other built-in widget and expect it to somehow still work.

          Comment

          Working...
          X