0 Replies Latest reply on Feb 5, 2007 10:29 AM by jag57

    How can I test a UIComponent to see if it is user editable?

    jag57
      My current code now loops through the children of a container and adds
      an event handler to each one to listen for a "change" event.

      However, I want to only add event handlers to UIComponents that have
      some sort of value that the user can change.

      Some examples of these components are: TextInput, ComboBox,
      RadioButton, CheckBox, ColorPicker, List, RichTextEditor, etc.

      My current code is something like this: (simplified)

      var component:UIComponent = container.getChildAt(i);
      if (component is Container)
      {
      // add event handlers to the container's children
      }
      else if (component is UIComponent && "enabled" in component)
      {
      // add an event handler to component
      }

      Unfortunately, this doesn't work for all the various input controls.
      e.g. The RichTextEditor is a Container, so the code tries adding event
      handlers to it's children (I want an event handler on the actual
      RichTextEditor).

      Is there a reliable way of detecting a user editable control?

      Thanks in advance!