2 Replies Latest reply on Oct 27, 2009 8:13 AM by JCC0

    Dynamic Inspectable in Flex Builder "Properties" viewer

    JCC0

      Hi all,

       

      I have created a custom component that has a property which needs to be set at design time with the name of an object within the data server.  The names available are located a XML file.  Ideally I'd like to present the user with some mechanism for selecting a name at design time using the "Properties" viewer.  At runtime, the custom component uses the selected name to communicate with the data server to get the object's current value.

       

      I've played around with the Inspectable types but I haven't found a way to create any type of dynamic selection.  Is this possible?  I can imagine lots of situations where you like to have the user select some dynamic property of a custom control at design time.  If it is possible, can someone provide a working example?  I'd like to provide either a filtered(as the user types the name) combobox with the names listed or a text field that has a "..." button that pops up a dialog for the name selection.

       

      Note that I'm new to the Flex/Flash Builder world,  any help will be greatly appreciated.

        • 1. Re: Dynamic Inspectable in Flex Builder "Properties" viewer
          cksachdev Level 1

          If your XML is static, then you can embed it and show values in a Combo Box,

          and edit your design.xml file to show combo box. but if you want to fetch

          this xml from server, in design mode, I doubt if there is a straight way to

          achieve this. What I can think of is, add a handler for initialize event and

          then load your xml in initialize and put a timeout/delay for some seconds.

          But it is not the right way

           

          --

          Chetan Sachdev

          • 2. Re: Dynamic Inspectable in Flex Builder "Properties" viewer
            JCC0 Level 1

            Actually the XML file is a local file that should be available from the PC running Flex/Flash Builder.  The XML file will be different from one project to another that uses the custom control.  I could possibly add the XML file to my project in a specific location, if that would make it easier.  This way it could check for the XML files existence and use it if available.  Otherwise the property would have to be entered manually.  Does the fact that the XML file is available locally change anything?  Can you point me to an example of how to provide an initialize handler that works to change a design time property?

             

             

            FYI, the XML file mentioned above is for a turnkey system(server) that is running on an embedded controller/server.  Each server is very specific to the customer and it would be great to leverage the Flex/Flash Builder as an IDE for contructing the UI that will be the web control for the system.  We are evaluating if this is the right tool for this purpose.