Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Infinite Redraws of a window when shown

$
0
0
We are experiencing some weird and random flashing (hiding/showing) of scroll bars in windows and canvases, as they're being continuously redrawn in a an infinite loop. This happens in certain browsers (IE9, Chrome) when we bring up certain windows in our app . At this point we can't really figure out what's triggering this behavior, and we're stuck on how to address it, and so I am posting this question here, along with a standalone test case hoping for some feedback, and directions on how to best handle these situations. This particular test case I am providing below reproduces this behavior on IE9 only (Chrome and FF work fine). We have many other cases where the window exhibits this behavior on other browsers. So I guess I have two questions:

1) Is what am experiencing in this test case a bug in SmartGWT?
2) Given that I am also seeing this behavior in other dialogs that are different than this one (i.e. smaller than the main canvas, but contain multiple forms in a SectionStack, is the issue there related to this one? What's the best way to handle issues like these?

Problem happens in SmartGWT4.1p, and 5.1d(Build 2015-05-14), and GWT2.6.1

Any help is greatly appreciated.

Mike

Code:

public class MainEntryPoint implements EntryPoint {
    /**
    * Creates a new instance of MainEntryPoint
    */
    public MainEntryPoint() {
    }

    /**
    * The entry point method, called automatically by loading a module
    * that declares an implementing class as an entry-point
    */
    public void onModuleLoad() {
        final VLayout layout = new VLayout();
        layout.setWidth("100%");
        layout.setHeight("100%");

     
        final TestWindow win = new TestWindow();
        win.setVisible(false);

        IButton openBtn = new IButton("Open Window");
        openBtn.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                win.moveTo(layout.getPageLeft(), layout.getPageTop());
                win.resizeTo(layout.getInnerWidth(), layout.getInnerHeight() );

                win.show();
            }
        });

        layout.addResizedHandler(new ResizedHandler() {

            public void onResized(ResizedEvent event) {
                win.resizeTo(layout.getInnerWidth(), layout.getInnerHeight());
            }
        });

        HLayout hl1 = new HLayout();
        hl1.setWidth100();
        hl1.setLayoutRightMargin(5);
        hl1.addMember(openBtn);
        layout.addMember(hl1);

        layout.draw();
    }
}


Code:

public class TestWindow extends Window {

    public TestWindow() {
        setIsModal(true);
                setShowModalMask(true);
                setModalMaskOpacity(40);

                setCanDragReposition(false);

                setBorder("0px");
                setShowEdges(false);
                setShowHeader(false);

                setShowShadow(true);
                setShadowSoftness(10);
                setShadowOffset(5);

                ImgButton closeButton = new ImgButton();
                closeButton.setSrc("[SKIN]/headerIcons/close.png");
                closeButton.setSize(16);
                closeButton.setShowFocused(false);
                closeButton.setShowDown(false);

                closeButton.addClickHandler(new ClickHandler() {

                        public void onClick(ClickEvent event) {
                                hide();
                        }
                });

                HLayout hl = new HLayout();
                hl.setWidth100();
                hl.setAutoHeight();
                hl.setAlign(Alignment.RIGHT);
                hl.addMember(closeButton);

                addItem(hl);
    }
}


Viewing all articles
Browse latest Browse all 4756

Trending Articles