Announcement

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

    smart gwt beginner- error when trying to define click handler for ibutton element

    am trying to run some code from the Showcase.

    For the section of code given below---

    IButton reset = new IButton("<b>Reset</b>");
    reset.setLeft(260);
    reset.setTop(150);
    reset.addClickHandler(new ClickHandler() {
    public void onClick(ClickEvent event) {
    anim.setRect(100, 250, 100, 100);
    anim.setOpacity(100);
    anim.scrollTo(0, 0);
    anim.show();
    dest.setRect(400, 200, 200, 200);
    scroller.setRect(640, 10, 100, 160);
    scroller.scrollTo(0, 0);
    }
    });
    I am getting an error for "reset.addClickHandler(new ClickHandler() { ........."

    The method addClickHandler(ClickHandler) in the type Canvas is not applicable for the arguments (new ClickHandler(){})


    How do I rectify this error? I am using directly the code provided in the showcase. I am using SmartGWT ver 3 in my java web app.

    #2
    There are several ClickHandler interfaces, you have probably imported wrong one in this context. CHeck your import and compare with what IButton.addClickHandler() expects in argument.

    Comment

    Working...
    X