You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by mo...@comcast.net on 2013/12/01 19:21:58 UTC

is there a way to auto-size width of component?

I have a spark FormItem containing a spark TextInput. Throughout the app this is made visible and invisible. When it is invisible, I want the width to be 0 so that it doesn't effect the layout other (visible) form items. 

Is there a simple way upon turning it back to visible, that I can have it auto-size itself to the correct width, or must I hardcode the width? Just curious, as I have a lot of such FormItems, and an auto-size method would save a lot of development time, especially as things change. For example, if I set the width to be -1, will this trigger the component to auto-size itself? 

RE: is there a way to auto-size width of component?

Posted by Devesh Mishra <De...@mastek.com>.
One simplest way to achieve the same is that use a HGroup/Vgroup component and change the value of visible & includeLayout property to true & false according to your requirement. 

-----Original Message-----
From: piotr.zarzycki [mailto:piotrzarzycki21@gmail.com] 
Sent: 02 December 2013 00:42
To: users@flex.apache.org
Subject: Re: is there a way to auto-size width of component?

Hi modjklist.

Maybe your solution is includeInLayout property.

Try to set visible = false and includeInLayout = false - It means that your
component will not affect in the position of other components. 

Piotr



-----
Flex/Air developer open to new job offers and challenges.
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/is-there-a-way-to-auto-size-width-of-component-tp4030p4031.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.
MASTEK LTD.
In the US, we're called MAJESCOMASTEK

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that of Mastek Limited, unless specifically indicated to that effect. Mastek Limited does not accept any responsibility or liability for it. This e-mail and attachments (if any) transmitted with it are confidential and/or privileged and solely for the use of the intended person or entity to which it is addressed. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. This e-mail and its attachments have been scanned for the presence of computer viruses. It is the responsibility of the recipient to run the virus check on e-mails and attachments before opening them. If you have received this e-mail in error, kindly delete this e-mail from desktop and server.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Re: is there a way to auto-size width of component?

Posted by "piotr.zarzycki" <pi...@gmail.com>.
Hi modjklist.

Maybe your solution is includeInLayout property.

Try to set visible = false and includeInLayout = false - It means that your
component will not affect in the position of other components. 

Piotr



-----
Flex/Air developer open to new job offers and challenges.
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/is-there-a-way-to-auto-size-width-of-component-tp4030p4031.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: is there a way to auto-size width of component?

Posted by mo...@comcast.net.
Oh, maybe you were intending to ALSO set the includeInLayout at the same time as setting visible property. In that case, it should work. Good idea. Thanks! 

----- Original Message -----

From: modjklist@comcast.net 
To: users@flex.apache.org 
Sent: Sunday, December 1, 2013 11:50:58 AM 
Subject: Re: is there a way to auto-size width of component? 

Thanks Evyatar, but includeInLayout does not make the component invisible. 

----- Original Message ----- 

From: "Evyatar Ben Halevi-Arbib" <ev...@gmail.com> 
To: users@flex.apache.org 
Sent: Sunday, December 1, 2013 11:15:26 AM 
Subject: Re: is there a way to auto-size width of component? 

Instead of manipulating the width just use the includeInLayout property 
(set to false when visible is false). 

Regards, 
Evyatar 


On Sun, Dec 1, 2013 at 8:21 PM, <mo...@comcast.net> wrote: 

> I have a spark FormItem containing a spark TextInput. Throughout the app 
> this is made visible and invisible. When it is invisible, I want the width 
> to be 0 so that it doesn't effect the layout other (visible) form items. 
> 
> Is there a simple way upon turning it back to visible, that I can have it 
> auto-size itself to the correct width, or must I hardcode the width? Just 
> curious, as I have a lot of such FormItems, and an auto-size method would 
> save a lot of development time, especially as things change. For example, 
> if I set the width to be -1, will this trigger the component to auto-size 
> itself? 
> 



Re: is there a way to auto-size width of component?

Posted by mo...@comcast.net.
Thanks Evyatar, but includeInLayout does not make the component invisible. 

----- Original Message -----

From: "Evyatar Ben Halevi-Arbib" <ev...@gmail.com> 
To: users@flex.apache.org 
Sent: Sunday, December 1, 2013 11:15:26 AM 
Subject: Re: is there a way to auto-size width of component? 

Instead of manipulating the width just use the includeInLayout property 
(set to false when visible is false). 

Regards, 
Evyatar 


On Sun, Dec 1, 2013 at 8:21 PM, <mo...@comcast.net> wrote: 

> I have a spark FormItem containing a spark TextInput. Throughout the app 
> this is made visible and invisible. When it is invisible, I want the width 
> to be 0 so that it doesn't effect the layout other (visible) form items. 
> 
> Is there a simple way upon turning it back to visible, that I can have it 
> auto-size itself to the correct width, or must I hardcode the width? Just 
> curious, as I have a lot of such FormItems, and an auto-size method would 
> save a lot of development time, especially as things change. For example, 
> if I set the width to be -1, will this trigger the component to auto-size 
> itself? 
> 


Re: is there a way to auto-size width of component?

Posted by Evyatar Ben Halevi-Arbib <ev...@gmail.com>.
Instead of manipulating the width just use the includeInLayout property
(set to false when visible is false).

Regards,
Evyatar


On Sun, Dec 1, 2013 at 8:21 PM, <mo...@comcast.net> wrote:

> I have a spark FormItem containing a spark TextInput. Throughout the app
> this is made visible and invisible. When it is invisible, I want the width
> to be 0 so that it doesn't effect the layout other (visible) form items.
>
> Is there a simple way upon turning it back to visible, that I can have it
> auto-size itself to the correct width, or must I hardcode the width? Just
> curious, as I have a lot of such FormItems, and an auto-size method would
> save a lot of development time, especially as things change. For example,
> if I set the width to be -1, will this trigger the component to auto-size
> itself?
>