Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Problem with StackPanel

36 views
Skip to first unread message

Cesar Redondo

unread,
Feb 14, 2013, 11:10:41 AM2/14/13
to gwtm...@googlegroups.com
Hello i need add dynamically element in the content of stack panel but the content layout is not resizable automatically.

Anyone have a posible solution for my problem?


Thanks

Nick Floros

unread,
Feb 16, 2013, 1:12:20 PM2/16/13
to gwtm...@googlegroups.com
Had the same problem ... trying to embed google maps within one of the panels of a stack panel - it was made worse by the fact that height of header for each panel varied.

My answer to it was to capture resize events at the root panel and then calculate the available size.
This is a brute force solution to something that I suspect there should be a more elegant solution to it.

Nick

Zhihua (Dennis) Jiang

unread,
Feb 17, 2013, 10:15:46 PM2/17/13
to gwtm...@googlegroups.com
I am guessing that when the stack expands, the dynamic content is not attached to the stack, or not yet fully populated to have a correct height (the expand method on the Stack class uses the scroll height). If you collapse the stack and then expanded it the second time, and the stack resizes correctly, that will prove the stack did not get the content's scroll height right the first time. Try adding the method to the stack class and call it once the dynamic content is fully poluated (at least when the height is figured out), and see if it helps any.

    public void resize() {
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
Utils.Console(_content.getElement().getScrollHeight() - _content.getElement().getOffsetHeight() + "px");
       _content.setHeight(_content.getElement().getScrollHeight() - _content.getElement().getOffsetHeight()+ "px");
}
});
    }



--
You received this message because you are subscribed to the Google Groups "GWT Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gwtmobile+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages