7 Replies Latest reply on Dec 2, 2016 5:25 PM by ccoffee RSS
    ccoffee Newbie

    How do i make a value display editable?

    hey guys, i have the need to make a value display editable. I am using them in a mashup, then using a repeater to simulate a grid. I am using the value display so i can use state definitions. Thanks

      • Re: How do i make a value display editable?
        ttielebein Collaborator

        What exactly do you mean by editable? Like how a grid is editable? I do not think there is any way to do this. You may need a custom widget

        • Re: How do i make a value display editable?
          Ankit Gupta Ninja

          Hi Chris Coffee,

           

          Value display widget as the name suggests is only for displaying the data. It is not editable.

          Grid widget also gives option for State formatting. Please share more details so that we can help you further.

          You would need to customize the widget (i.e. create your own custom widget) as Tori said. You can use the original Value Display widget as the base.

           

          Thanks,

          Ankit Gupta

          • Re: How do i make a value display editable?
            ccoffee Newbie

            Thanks for the responses guys. I will look into creating a custom widget based on the value display widget.

            • Re: How do i make a value display editable?
              jamesm Creator

              Hey Chris,

               

              Is there any reason you wouldn't just use an editable grid, instead of the repeater? You can apply state definitions and formatting to the Configure  Grid Columns >>  Column Renderer and  State Formatting. Then, any time the table is edited, you can write the new value, requery  the data, and it will have the correct formating for the new value.

               

              Let me know if you think this would work.

              • Re: How do i make a value display editable?
                ccoffee Newbie

                Yeah,  I played with that. If you make a column editable it loses all the state definition functionality. I can always use a popup mashup for the editing of data, i was hoping they already had a widget that both allowed you to edit and kept the state definition. Of course i'm new to thingworx and could be doing it wrong. Plus the repeater allows me to view my dataset in vertical rows instead of horizontal rows.

                 

                Thanks for your response

                  • Re: How do i make a value display editable?
                    jamesm Creator

                    Ok, got it. One other option: If you put the value display in a panel, you could add the statebased formatting to the value display. Then, add a second widget (probably a textbox) and put it above the value display, with a higher z index. Set the textbox visible to false, and the value display to true.

                    Add a checkbox widget and place it next to the value display, and an expression widget anywhere. Tie the State from the checkbox to the Visible property for the textbox widget and to some input boolean on the expression (I called mine editState) and set the expression to !editState and bind the (boolean) output to the Visible property on the value display. Finally, bind the text from the textbox to the data for the value display and the have the Changed event on the Checkbox widget fire the expression Evaluate.

                     

                    This  should now let you toggle between the value display and the text box, edit the value when in edit mode, and pass it back to the value display with the right formatting.