4 Replies - 445 Views - Last Post: 20 January 2013 - 11:59 PM Rate Topic: -----

#1 cupidvogel  Icon User is offline

  • D.I.C Addict

Reputation: 31
  • View blog
  • Posts: 593
  • Joined: 25-November 10

Problem with blur function in GWTquery

Posted 20 January 2013 - 12:01 PM

The following code attaches a new element with every subsequent click on the 2nd div. With each adding, the focus is set to the added element, so that it is ready for blur methods (I am setting the tabIndex attribute just for this purpose.).

However, on clicking outside the new element, nothing happens, even though there should be a pop-up. Can anyone tell me what's wrong with this code?

    public void onModuleLoad() {
        VerticalPanel vert = new VerticalPanel(); 
        String foo = "<div id ='foo'>Foo</div>";
        $("#bodywrapper").append(foo);
        $("#bodywrapper").append("<div id ='boo'>Boo</div>");
        $("#boo").click(new Function() {
            public boolean f(Event e) {
//              window.alert("foo");
                $("<div id ='goo' tabIndex = '1'>Boo</div>").appendTo("#bodywrapper").focus();
                return true;
            }
        });
        $("#goo").live("blur", new Function() {
            public boolean f(Event e) {
                window.alert("Foo");
                return true;
            }
        });
        RootPanel.get().add(vert);

      }
}


This post has been edited by cupidvogel: 20 January 2013 - 12:02 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Problem with blur function in GWTquery

#2 natecat  Icon User is offline

  • D.I.C Head

Reputation: 53
  • View blog
  • Posts: 225
  • Joined: 19-December 11

Re: Problem with blur function in GWTquery

Posted 20 January 2013 - 08:45 PM

This doesn't seem to be java
Was This Post Helpful? 0
  • +
  • -

#3 raghav.naganathan  Icon User is offline

  • Perfectly Squared ;)
  • member icon

Reputation: 408
  • View blog
  • Posts: 1,440
  • Joined: 14-September 12

Re: Problem with blur function in GWTquery

Posted 20 January 2013 - 08:51 PM

Well, there is a lot of difference between Java and Javascript...Java is a programming language but Javascript is a client-side scripting language.

Except for the lines 1 to 3, everything else falls under Jquery part.

To the mod: I think Javascript/ Jquery forum will be appropriate for this question...can you please move the post to the appropriate forum.

Thanks

regards,
Raghav
Was This Post Helpful? 0
  • +
  • -

#4 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10461
  • View blog
  • Posts: 38,755
  • Joined: 27-December 08

Re: Problem with blur function in GWTquery

Posted 20 January 2013 - 11:46 PM

GWTQuery is a third party project that allows the use of jQuery-like commands in GWT Projects. GWT is a third party Java UI toolkit. The Java forum is fine, as is probably the JS forum. I'll let cupidvogel shoot me a PM if he wants it moved, but I don't think this is the wrong place.

Quote

To the mod: I think Javascript/ Jquery forum will be appropriate for this question...can you please move the post to the appropriate forum.

In the future, please just report threads you think should be moved and a team member will make the decision from there. It helps keep the clutter out of the forums. :)
Was This Post Helpful? 1
  • +
  • -

#5 raghav.naganathan  Icon User is offline

  • Perfectly Squared ;)
  • member icon

Reputation: 408
  • View blog
  • Posts: 1,440
  • Joined: 14-September 12

Re: Problem with blur function in GWTquery

Posted 20 January 2013 - 11:59 PM

View Postmacosxnerd101, on 21 January 2013 - 12:16 PM, said:

GWTQuery is a third party project that allows the use of jQuery-like commands in GWT Projects. GWT is a third party Java UI toolkit. The Java forum is fine, as is probably the JS forum. I'll let cupidvogel shoot me a PM if he wants it moved, but I don't think this is the wrong place.

Thank you Mac for that knowledge. :) That was very informative indeed :)

Quote

In the future, please just report threads you think should be moved and a team member will make the decision from there. It helps keep the clutter out of the forums. :)


Yes, I shall make sure to report topics to be moved instead of explicitly specifying in the post.

Thanks

regards,
Raghav
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1