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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Selected drop down value on mashup load

pbaierl
1-Newbie

Selected drop down value on mashup load

I am loading some drop down lists with string values that are used to display a variety of values depending on the selection.

I have a data table that stores the settings per user so that each time the page is loaded the proper values are restored as they were last configured.  My data is being display correctly in my grid based on the saved values in the data table.  However, the selected value is not reflected/displayed in the list widget when the mashup is loaded.

I have tried a number of things to try to get the selected values to be shown in the list widget when the mashup loads, but so far I have not had any success.  I am attempting to use the SelectedText parameter, but this doesn't seem to be doing anything.  Do I need to create a list of numerical values to tie to the ValueField in order to get this working?

Please let me know what I am missing.  I have tried the same setup in two versions of ThingWorx Composer to make sure it wasn't an issue in my current version.

Thanks,

Pauls

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Paul,

What you are doing should work, I do it. Then you are doing something wrong, my two cents:

  1. SelectedText should be ValueField not DisplayField, the name it's confusing I know.
  2. SelectedText should be filled before loading the List Data content ( better you trigger the service which fills the Data with ServiceInvokeCompleted from User Settings )
  3. Don't set AutoSelectFirstRow=true

Best Regards,

Carles

View solution in original post

10 REPLIES 10
ttielebein
12-Amethyst
(To:pbaierl)

I am a bit confused. What exactly is supposed to be showing in the drop down list? What does show in the drop down list instead?

I have a list of parameters Thing 1 - Thing 10.  My drop down list loads the data correctly.

I can select any of the 10 things in the list without a problem.  When the selected row changes I update my data table to store the newly selected value.

The problem comes in when I navigate to another mashup and come back.  When the mashup loads again the drop down box is empty even though I have the SelectedText parameter linked to the previously selected value.

For example: 

I see when my mashup first loads.

I am trying to restore the last selected value when the mashup loads.

ttielebein
12-Amethyst
(To:pbaierl)

Ok, that makes a lot more sense. I am still confused about how you are keeping track of the last selected. I think from what I read above, you are pushing this value to a data table? That seems a little overkill. Usually data tables are used to store data for long periods of time and not transiently. Have you tried using session variables? How are you doing the navigation? You could use mashup parameters too if you use the navigation widget, potentially.

I'm using a data table to track and store their settings so it only needs to be configured once.  They are essentially user preferences.  I can try to pass the selected value in another way.

ttielebein
12-Amethyst
(To:pbaierl)

Oh, I see. Well that should be working. Can you take a picture of the bindings from your data table query to the drop down list widget? What version of ThingWorx is this, also?

qngo
5-Regular Member
(To:pbaierl)

Hi, did you try to:

- Create a service to retrieve from the DataTable the last value selected and to return this value as String

- In the mashup, bind the result of this service to the property SelectedText of the Dropdown widget

- Execute this service on Mashup load

Hi Paul,

What you are doing should work, I do it. Then you are doing something wrong, my two cents:

  1. SelectedText should be ValueField not DisplayField, the name it's confusing I know.
  2. SelectedText should be filled before loading the List Data content ( better you trigger the service which fills the Data with ServiceInvokeCompleted from User Settings )
  3. Don't set AutoSelectFirstRow=true

Best Regards,

Carles

Thanks Carles,

I will give this a shot.  I do not have anything selected in the ValueField.  I suspected that was my issue.

You always have to have something on ValueField

Thanks I figured I was just missing something.  It's working great now thanks again!

Top Tags