Hi all,

I'm fairly sure this is a bug but I thought I'd ask about it here before I 
went and created an issue for it.

I'm using a CheckBox as the header of a DisclosurePanel, and since I'm 
already aware that the click handlers for the CheckBox are ignored I have 
created open and close handlers on the DisclosurePanel to manually set 
value of the CheckBox. This works splendidly so long as you click on the 
label of the CheckBox; the item is checked, the panel opens, and you see 
the new contents.

However, if you click on the input element of the CheckBox, the value still 
changes, and the disclosure panel still opens, but the visual indicator 
isn't drawn (or in the case of closing, removed). I've attempted to debug 
it as well as I can, and everything seems to be in place, everything firing 
as it should and the inputElem.setChecked(value) and 
.setDefaultChecked(value) are both getting hit (I *believe* they are the 
methods responsible for drawing, but not 100% sure).

Is there something I can do to fix this behaviour? As much as I'd like to 
leave it as good enough, my users are going to get frustrated by the most 
obvious interaction not working.

Thanks in advance for your help!

Here is a code sample:

public class CheckBoxBugExample extends Composite{

    private VerticalPanel container = new VerticalPanel();
    private CheckBox customResponseHeader = new CheckBox("Customize 
Message");
    private DisclosurePanel responderDisclosurePanel = new 
DisclosurePanel();

    public CheckBoxBugExample(){
        initWidget(container);
        responderDisclosurePanel.setHeader(customResponseHeader);
        responderDisclosurePanel.setContent(new HTMLPanel("Hello, world!"));
        container.add(responderDisclosurePanel);

        responderDisclosurePanel.addOpenHandler(new 
OpenHandler<DisclosurePanel>() {
            @Override
            public void onOpen(OpenEvent<DisclosurePanel> 
disclosurePanelOpenEvent) {
                customResponseHeader.setValue(true, true);
            }
        });

        responderDisclosurePanel.addCloseHandler(new 
CloseHandler<DisclosurePanel>() {
            @Override
            public void onClose(CloseEvent<DisclosurePanel> 
disclosurePanelCloseEvent) {
                customResponseHeader.setValue(false, true);
            }
        });
    }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/SFmh9sVdJFwJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to