-
21 Dec 2012 10:39 AM #1
TextButton active state gets stuck on
TextButton active state gets stuck on
Version(s) of Ext GWT
GXT 3.0.1 GPL
Browser versions and OS (and desktop environment, if applicable)
Firefox 17.0.1, Windows 7
Virtual Machine
NO
Description
If a button is selected where the handler swaps out the parent container of the selected button, then if that container is added back, the button's active state is stuck on. Mousing over, clicking away, etc does not remove the active state. Programmaticly the only way I have found to remove the active state is to disable then renable the button. redraw() and forcelayout() seem to have no effect. I also extended TextButton so I could explicityly try calling blur() to no avail.
Run mode
BOTH
Steps to reproduce the problem- Start running in development mode in Eclipse
- Open app in browser
- Click the "Go" button
- Click the "Cancel" button (Go button's active state is now stuck on)
When returning to the original button's container I would expect the button to be ready to go again same as if a mouse out or blur event had occurred.
Actual result
The active state is stuck on.
Test case
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.FlowLayoutContainer;
import com.sencha.gxt.widget.core.client.container.Viewport;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class GXTSandBox implements EntryPoint
{
/**
* This is the entry point method.
*/
public void onModuleLoad ()
{
final FlowLayoutContainer goContainer = new FlowLayoutContainer();
final FlowLayoutContainer cancelContainer = new FlowLayoutContainer();
final Viewport viewport = new Viewport();
viewport.add(goContainer);
final TextButton goButton = new TextButton("Go");
goButton.addSelectHandler(new SelectHandler()
{
public void onSelect (SelectEvent event)
{
viewport.setWidget(cancelContainer);
}
});
goContainer.add(goButton);
TextButton cancelButton = new TextButton("Cancel");
cancelButton.addSelectHandler(new SelectHandler()
{
public void onSelect (SelectEvent event)
{
viewport.setWidget(goContainer);
}
});
cancelContainer.add(cancelButton);
RootPanel.get().add(viewport);
}
}
-
26 Dec 2012 12:14 PM #2
Thanks for the report! I've confirmed this issue and filed it in our bugtracker. I don't presently have a workaround, but if we find one, or have a fix ready, we'll update this thread to mention it.
-
2 Jan 2013 10:39 AM #3
This has been committed to SVN and will be available in the next release. The fix is essentially to clear these styles when the button is detached from the DOM - this can be done in a subclass in your own code, or with a detach handler.
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTGWT-2722
in
3.0.4.


Reply With Quote