• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

how to add default values when adding custom component to design view?

Guest
Oct 05, 2011 Oct 05, 2011

Copy link to clipboard

Copied

I have a set of custom components (usually) extending Spark components. But when adding our custom component onto design view, how can I define defult values (in AS3).

For example, s:Button has default label = 'Button' when added to application, or mx:DataGrid has 3 columns predefined, but when using custom components there are no predefined values like this.

I can put this values in constructor, but they are not visible in design time, only runtime.

Any ideas? Thanks

Esmin

Views

621

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Oct 10, 2011 Oct 10, 2011

yes, I am. By the way I've found the solution. Someone might find this usefull.

In design.xml having

<component name="ExtendedTextInput" namespace="mynamespace" category="beta" displayName="ExtendedTextInput"/>

use this

<component name="ExtendedTextInput" namespace="mynamespace" category="beta" displayName="ExtendedTextInput">

        <defaultAttribute name="text" value="ExtendedTextInput"/>

    </component>

so when adding this component to design view, it will have text setted to value ('ExtendedTex

...

Votes

Translate

Translate
Participant ,
Oct 06, 2011 Oct 06, 2011

Copy link to clipboard

Copied

Are you calling super in your constructor?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 10, 2011 Oct 10, 2011

Copy link to clipboard

Copied

LATEST

yes, I am. By the way I've found the solution. Someone might find this usefull.

In design.xml having

<component name="ExtendedTextInput" namespace="mynamespace" category="beta" displayName="ExtendedTextInput"/>

use this

<component name="ExtendedTextInput" namespace="mynamespace" category="beta" displayName="ExtendedTextInput">

        <defaultAttribute name="text" value="ExtendedTextInput"/>

    </component>

so when adding this component to design view, it will have text setted to value ('ExtendedTextInput' in this case).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines