Resizing a FlowPanel containing widgets

93 views
Skip to first unread message

Andrei F

unread,
Jul 20, 2011, 10:47:57 AM7/20/11
to GWT-FX
Hello, i'm trying to resize a FlowPanel (div element with
display:block) that contains other widgets (other panels and labels)

This panel is in a vertical panel but i cannot play the effect because
of an exception:

java.lang.RuntimeException: Computed style for width is auto - try
setting a start value explicitly
at
org.adamtacy.client.ui.effects.impl.css.StyleImplementation.getComputedStyle(StyleImplementation.java:
113)

My FlowPanel has an explicit width, but it seams that every contained
element is checked for width auto.
I'm I wrong ? or can i apply the effect only on the parent element
(which is the FlowPanel) ?
What can i do ?

Adam T

unread,
Jul 20, 2011, 11:40:57 AM7/20/11
to GWT-FX
Hi Andrei,

The resize effect will attempt to resize the element you pass as well
as all of it's components - that's why it's checking to see if it can
determine the widths etc for each component (and will fail if the
browser just tells it it is "auto", as there's no way for it to
understand what that actually means in terms of a number to scale
from).

If you're just after changing the dimensions of your FlowPanel, then
I'd suggest best to use a NMorphStyle effect with two rules, for
example to change the dimensions from 600x300 to 200x800, you could do
something similar to (where content is your FlowPanel):

// Define some css style rules
Rule start = new Rule("s{width:600px; height:300px;}");
Rule end = new Rule("e{width:200px; height:800px;}");
// Create and apply the effect
NMorphStyle changeSize = new NMorphStyle(content.getElement(),
start, end);
// play the effect
changeSize.play(0.0, 1.0);

Hope that helps!

//Adam
Reply all
Reply to author
Forward
0 new messages