Robot Legs examples - Widget Factory Demo

visnik's Avatar


28 Jul, 2011 08:45 PM

I have decided to go through and really analyze the examples on gethub to hopefully get a better understanding robot legs, as there is still a lot i don't understand. I am hoping this is a good place to ask questions regarding those examples.

OK, I am 2 seconds into looking at the Widget Factory Demo and I something odd seemed to have jumped out at me, and I am totally missing something.

When the app is run, the Create Widget, Poke Widget and Destroy Widget buttons are disabled, as soon as you type in the widgetId field the buttons become active..... OK, no big deal, there is just a change event happening somewhere right......well I can't seem to find it.

I looked in the ControlPanelMediator and found no event map for the view.widgetId, or anywhere a event.CHANGE is happening within this mediator.

Where and how is typing in the text field telling the three buttons to become active?

Thanks, Joe

  1. Support Staff 1 Posted by Ondina D.F. on 29 Jul, 2011 07:44 AM

    Ondina D.F.'s Avatar

    Hi Joe:)

    I think it’s the true or false result from the statement widgetId.text.length>0 that sets enabled to true or false.

    When you start typing in the widgetId.text widgetId.text.length==1 (>0),
    meaning true, if you delete the text widgetId.text.length==0, meaning false

    try this:
    <mx:Button id="createWidgetButton"
    label="Create Widget"
    enabled="{widgetId.text.length==3}" width="100%"/>
    <mx:Button id="pokeWidgetButton"
    label="Poke Widget"
    <mx:Button id="destroyWidgetButton"
    label="Destroy Widget"
    enabled="{widgetId.text.length>0}" width="100%"/>


  2. 2 Posted by visnik on 29 Jul, 2011 05:05 PM

    visnik's Avatar

    Oh, I see now, tricky, I was so expecting it to be handled via the mediator. Thanks again for your help Ondina,

  3. Support Staff 3 Posted by Ondina D.F. on 29 Jul, 2011 05:08 PM

    Ondina D.F.'s Avatar

    Hey Joe,

    Oh, I see now, tricky, I was so expecting it to be handled via the mediator.

    Yes, hidden in the component itself :)

  4. Support Staff 4 Posted by Ondina D.F. on 29 Jul, 2011 05:09 PM

    Ondina D.F.'s Avatar

    Ah, you can close the discussion, I guess.

  5. visnik closed this discussion on 29 Jul, 2011 08:08 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac