cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

How do i make a value display editable?

ccoffee
1-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

1 ACCEPTED SOLUTION

Accepted Solutions
jamesm1
5-Regular Member
(To:ccoffee)

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.

View solution in original post

7 REPLIES 7
ttielebein
12-Amethyst
(To:ccoffee)

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

ankigupta
5-Regular Member
(To:ccoffee)

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

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

jamesm1
5-Regular Member
(To:ccoffee)

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.

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

jamesm1
5-Regular Member
(To:ccoffee)

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.

Nice idea James, i will try that and see if i like it better than the popup box.

Thanks

Top Tags