Hi,
I don't want sectionHeaders, so I setShowHeader(false).
I add these sections, and all goes well.
Now I've got a script which hides some sections and shows some sections, which gives the effect as though the stack is being replaced with new sections.
But when doing this, the sectionheaders pop-up again. I'm even trying to re-set the setShowHeader(false), but that doens't work anymore.
Reprocase: press the button a few times to see the unexpected headers come back suddenly.
TIA
IE8 GWT 2.1 dev mode SmartClient Version: SC_SNAPSHOT-2010-10-27/EVAL Deployment
I don't want sectionHeaders, so I setShowHeader(false).
I add these sections, and all goes well.
Now I've got a script which hides some sections and shows some sections, which gives the effect as though the stack is being replaced with new sections.
But when doing this, the sectionheaders pop-up again. I'm even trying to re-set the setShowHeader(false), but that doens't work anymore.
Reprocase: press the button a few times to see the unexpected headers come back suddenly.
Code:
private class MySec extends SectionStackSection { public MySec(String text) { this.setExpanded(true); this.setCanCollapse(false); this.setResizeable(false); this.setShowHeader(false); Label label = new Label(); label.setContents(text); this.setItems(label); } } private VLayout getTest6() { VLayout result = new VLayout(); final SectionStack stack = new SectionStack(); stack.setVisibilityMode(VisibilityMode.MULTIPLE); stack.setAnimateSections(true); stack.setShowResizeBar(true); stack.setWidth(220); final MySec section1 = new MySec("A"); final MySec section2 = new MySec("B"); final MySec section3 = new MySec("C"); stack.setSections(section1, section2); //Click the button to switch sections (actually hide/show and add if needed) final Button b = new Button("2"); b.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { SectionStackSection[] existingSections = stack.getSections(); SectionStackSection[] sections; if (b.getTitle().equals("2")) { sections = new SectionStackSection[]{section3}; b.setTitle("1"); } else { sections = new SectionStackSection[]{section1, section2}; b.setTitle("2"); } boolean [] containsSection = new boolean[sections.length]; for (int i=0; i<existingSections.length; i++) { stack.hideSection(i); for (int j=0; j<sections.length; j++) { if (sections[j].getID().equals(existingSections[i].getID())) { containsSection[j] = true; if (existingSections[i].getAttributeAsBoolean("expanded")) { //Somewhere during hideSection the expandable sections are collapsed // so we need to expand them again ourselves. stack.expandSection(i); } //uuuh, and somewhere during the switch, the header comes up again existingSections[i].setShowHeader(false); stack.showSection(i); break; } } } for (int j=0; j<sections.length; j++) { if (!containsSection[j]) { //uuuh, and somewhere during the switch, the header comes up again sections[j].setShowHeader(false); stack.addSection(sections[j]); } } } }); result.setMembers(stack, b); return result; }
IE8 GWT 2.1 dev mode SmartClient Version: SC_SNAPSHOT-2010-10-27/EVAL Deployment
Comment