Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Updating contents of a SectionStack

    I am a bit confused as to why this is happening. I've done some searching here on the forums but, I have not found any solution yet.

    I have a SectionStack that I would like to add/remove contents after it has been created. I don't seem to have any problems adding the content. However, the content will not show up unless I collapse the stack and expand it again.

    I have tried using redraw() on both the HLayout and the SectionStack. I have tried using markForRedraw() as well. What am I missing?

    Here is a quick mockup of the problem.

    Code:
    public void onModuleLoad() {
    	final HLayout mainLayout = new HLayout();
    	mainLayout.setHeight100();
    
    	final SectionStack stack = new SectionStack();
    	stack.setHeight(300);
    	stack.setVisibilityMode(VisibilityMode.MULTIPLE);
    
    	final SectionStackSection sect = new SectionStackSection("Test");
    	sect.setExpanded(true);
    	IButton btnAdd = new IButton("+");
    	btnAdd.setWidth(70);
    	btnAdd.addClickHandler(new ClickHandler() {
    		public void onClick(ClickEvent event) {
    			sect.addItem(new Label("ITEM ADDED"));
    			stack.redraw();
    		}
    	});
    	sect.addItem(btnAdd);
    	stack.addSection(sect);
    
    	mainLayout.addChild(stack);
    
    	mainLayout.draw();
    }
    -Mohkev

    #2
    I have to be missing something. Do SectionStackSection objects lack the ability to have items added to them after they have been added to a SectionStack?

    I've been able to update the contents of a label that was added to the section *before* the section was added to the stack.

    I'm using SmartGWT v2.2, GWT v2.0.4 on Windows XP Pro SP3

    I've tried this in hosted mode, and on the following browsers:
    Firefox 3.6.8
    Chrome 5.0.375.125
    Safari 4.0.5 (531.22.7)
    Opera 10.60 b3445
    IE 8.0.6001.18702

    I get the exact same result with each of these.

    -Mohkev

    Comment

    Working...
    X