4 Replies Latest reply on Aug 12, 2009 10:01 PM by satyamurthy_hyd

    Dynamically adding/removing UIComponent As per incremental in XML data

    satyamurthy_hyd

      Hi All,

      I want solution for How can we add / remove UI component as per incremental XML data.

      For example the components are UI1.mxml,UI2.mxml,UI3.mxml,UI4.mxml

      I have a container lets say HBox and accomodating only two UI components at any time.

      as the the xml data i have to show UI randomly(i.e incremental values in XML).

      I need code similar to this

       

      object:Object;

      if(xmlui==UI1)

      object=UI1

      else if(xmlui==UI2)

      object=UI2;

      else if(xmlui==UI3)

      object=UI3;

        • 1. Re: Dynamically adding/removing UIComponent As per incremental in XML data
          Madhav Subedi Level 4

          use repeater, and for each item, create all 3 UI, which one to show depending upon the item data, and use visible/includeInLayout property.

           

          <local:UI1 visible="{repeater.currentItem.xmlui == 'UI1'}" includeInLayout="{repeater.currentItem.xmlui == 'UI1'}">

          <local:UI2 visible="{repeater.currentItem.xmlui == 'UI2'}" includeInLayout="{repeater.currentItem.xmlui == 'UI2'}">

          <local:UI3 visible="{repeater.currentItem.xmlui == 'UI3'}" includeInLayout="{repeater.currentItem.xmlui == 'UI3'}">

          • 2. Re: Dynamically adding/removing UIComponent As per incremental in XML data
            satyamurthy_hyd Level 1

            Hi Madhav,

            I appreciate any of sample example to understand and i guess if i use repeater, the UI may flicker and UI should be flicker fee

             

            regards

            • 3. Re: Dynamically adding/removing UIComponent As per incremental in XML data
              Gregory Lafrance Level 6

              Using a Repeater won't result in flickering, but we need more information on what you are trying to achieve here as it is not clear enough.

               

              Please provide a more detailed description.

              • 4. Re: Dynamically adding/removing UIComponent As per incremental in XML data
                satyamurthy_hyd Level 1

                Hi Greg,

                Greetings!!!

                Here is the details of the Problem description:

                I was asked to make web monitoring for the remote devices.

                There are 4 different devices(i.e device1,device2,device3,device4  and  having properties like id,name,color,status(ON/OFF) etc.) and can placed in a rack(let say container).

                The Rack may contain only 4 devices which is combination of the above said.

                Need to make a UI for simulating the system through a web application using flex.

                Now i want to simulate the system such that at run-time if devices in the rack is either added or removed should reflect on the flex UI as well simultaneously.

                 

                 

                NOTE: Currently I have created UI with HBox for Rack , Components for devices and XMLSocket program written for reading incremental xml data and could able to access remote data successfully .

                and the sample xml files are like follows:

                1.xml contain all 4 devices with some data

                2.xml contain only  devices data which has been changed

                3.xml contain data of device(s) removed from the rack

                4.xml contain data of device(s)added to the rack

                5.xml contain data of devices interchanged in the rack

                Please feel free to ask if the above info is not sufficient to understand the problem descritpion.

                I appreciate any of your suggestions or tips to find solution to my problem description

                 

                Thanks&Regards

                CSNPrasad.