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.
-Mohkev
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(); }
Comment