7 Replies Latest reply on Apr 3, 2017 9:16 AM by carlesc RSS
    fmanniti Creator

    Bind widget to properties dynamically

    I have THINGs that will be created runtime by the user and these THINGs have some fixed properties and some others that will be created dynamically; the only thing those properties have in common is they are all NUMBER.

    Now, I have a gadget with a widget inside (let's say a LED widget) which should be connected by one of those dynamics properties.

    I cannot do it by composer since I don't know the properties in advance. My question is:

    is there a way to bind properties to a widget by service?

    So that I could make a gadget with a dropdown list and the value displaied changes according to what is selected by the list.

     

    Thanks

      • Re: Bind widget to properties dynamically
        carlesc Ninja

        Why don't you list Thing's properties on a DropDown List?

          • Re: Bind widget to properties dynamically
            carlesc Ninja

            Also you can create a Inner Mashup which receives as parameter the Thing Name and the Property Name and acts accordingly.

             

            I have the same use case you say and well tougth it's not a problem at all. Well at the end for me it's everything Dynamic, then almost never I bind to specific properties...

              • Re: Bind widget to properties dynamically
                fmanniti Creator

                Thanks

                It's what I needed

                • Re: Bind widget to properties dynamically
                  fmanniti Creator

                  Just one more question, maybe you can help me.

                  I have my mashup so designed:

                  Leftside bar with the list of all THINGS, on the right my dashboard.

                  Now, let's say that, on my leftbar list I have those two things with the following properties (dynamically added)

                  ELEMENT_1 --> Properties: Bending, Temperature

                  ELEMENT_2 -->Properties: Flexion, Grade

                   

                  now, on my widget I have a LED display and a dropdown menu which lists my properties. Let's say I select Bending for ELEMENT_1 and Flexion for ELEMENT_2.

                  What happens is that when I switch from ELEMENT_1 to ELEMENT_2 my widget doesn't keep in memory my previous choice for ELEMENT_2.

                  I mean:

                  I select Bending for ELEMENT_1 and LED display the bending value, then I switch to ELEMENT_2 and the LED display is empty, so I select Flexion and LED displays flexion values but, when I switch back to ELEMENT_1 it is still blank.

                   

                  So, is there a way to "tell" my widget to 'memorize' the choice for each ELEMENT?