Closed GoogleCodeExporter closed 9 years ago
Did no one encounter this problem or gQuery works when gQuery is defined before
any element is put in the root panel?
Original comment by mtrebi...@gmail.com
on 18 Jul 2011 at 7:56
[deleted comment]
I didn't find time yet to investigate your problem but I suspect the
RootPanel.get() as being the cause of your problem.
The first time you call RootPanel.get(), it creates a DefaultRootPanel widget
and defines this widget as event listener for the body element and so removes
the custom gwtquery eventlistener set on the body element by the live method.
Original comment by julien.d...@gmail.com
on 19 Jul 2011 at 12:01
I confirm... you have to call the live method after the initialization of the
root panel. Otherwise, this initialization will remove the gwtquery event
listener to set its own.
This code below works :
public void onModuleLoad() {
//force initialization of the RootPanel
RootPanel.get();
$("button").live(Event.ONCLICK, new Function() {
public boolean f(Event e) {
Window.alert("click");
return false;
}
});
FlowPanel myPanel = new FlowPanel();
RootPanel.get().add(myPanel, 100, 100);
myPanel.add(new Button("Click"));
}
Original comment by julien.d...@gmail.com
on 19 Jul 2011 at 9:23
Is there a way to apply gquery on elements that are created in other java class?
let's say i have my main java.class that extends entry point. and inside this
one i'm calling "header" class where i have different anchors. where do i need
to put gquery declarations?
Original comment by mtrebi...@gmail.com
on 22 Jul 2011 at 8:17
Could you please ask your question in gwtquery group
(http://groups.google.com/group/gwtquery) ? It's the best way to receive an
answer and allow the other people to find easily response of already asked
questions.
Thanks
Original comment by julien.d...@gmail.com
on 22 Jul 2011 at 8:23
Original issue reported on code.google.com by
mtrebi...@gmail.com
on 15 Jul 2011 at 9:54