Friday, December 13, 2013

Re: Layout with nested SplitLayoutPanel

Just a hunch--I've not tried this--maybe you should instead override onLoad().

From the Javadocs:

onAttach: "It is strongly recommended that you override onLoad() or doAttachChildren() instead of this method to avoid inconsistencies between logical and physical attachment states."

onLoad: "This method is called immediately after a widget becomes attached to the browser's document."

I've had to deal a lot with sizing issues, like trying to size an AbsolutePanel or CustomScrollPanel a tab not yet selected or brought front. Nothing gets a size until the DOM realizes it. Though I have instantiated and attached widget in my code, the DOM may not have done it's thing yet. Getting it right can be frustrating (I'm not above using the occasional state variable to be sure the timing works).


On Friday, December 13, 2013 11:59:01 AM UTC-5, Magnus wrote:
Hi Patrick,

thanks, but it didn't help.

I call the resize method from within onAttach, but the value is still 0 (see below).

Magnus


 
 public void resetSplitters ()
 {
  int ys = this.getOffsetHeight ();
  Window.alert ("h:" + ys);
 }
 

 @Override
 protected void onAttach()
 {
  super.onAttach ();
  resetSplitters ();
 }

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate