Share

GWT Widget Library

Tracker: Bugs

5 WButton does not catch events - ID: 1885038
Last Update: Comment added ( samyem )

WButton does not respect addClickListener if it is not added to the parent.
It is not always possible to add to the parent as WButtons may be added to
DOM nodes that is not associated to any GWT level widgets.

I found that calling onAttach() on the constructor of WButton solves this
problem. Hope this gets added to the widgets lib.


Nobody/Anonymous ( nobody ) - 2008-02-02 03:34

5

Open

None

Nobody/Anonymous

None

None

Public


Comment ( 1 )




Date: 2008-02-02 13:14
Sender: samyemAccepting Donations


For eg:

HTML:
<body>
<div>
<button id="someButton"></button>
</div>
</body>

Code:
WButton button=new WButton("someButton");
button.addClickListener(...); //WON't work

button cannot be added to RootPanel.get() as this will move the button out
from the DIV into the BODY level. We do not want to create a panel at div
unnecessarily as well. Had WButton called the onAttach() event in
constructor, the above code would work.




Log in to comment.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.