defaultButton property in HBox control of Flex.

I found out one property that was actually hidden in the Control of HBox, i had a requirement and when i searched for that i found that hidden one.

And its really very use full in using that property and the functionality of defaultButton is know i think[ One reading this post] .

code example:

<mx:HBox defaultButton=”{btn}” >
<mx:Button id=”btn” label=”One”/>
<mx:Button id=”btnbtn” label=”Two”/>
<mx:Button id=”btnbtn” label=”Three”/>
</mx:HBox>

This property will also be defined in the other Alingment Tags.Enjoy the code.

6 Responses to “defaultButton property in HBox control of Flex.”

  1. Property Articles » Blog Archive » defaultButton property in HBox control of Flex. Says:

    [...] Original post by kumargandhi [...]

  2. cease Says:

    .mxml:[18,-1] Initializer for ‘defaultButton’: values of type mx.core.IFlexDisplayObject cannot be represented in text.

    didn’t work for me

  3. kumargandhi Says:

    Hi
    May you r missing something,It should work. Can you paste the sample code here.

    regards,
    kumar.

  4. Toby Says:

    Actually, the sample isn’t quite right. Curly braces are needed around the value of defaultButton as in:

  5. Toby Says:

    Oops – the code was munged. Should be defaultButton=”{btn}”

Leave a Reply