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

Select Widget default value

Wayne_Beck
12-Amethyst

Select Widget default value

I am using the select widget to select the sequence to play.  I would like to have this list default to a specific sequence.  Is this possible?

ACCEPTED SOLUTION

Accepted Solutions
ytella
17-Peridot
(To:Wayne_Beck)

Hi @Wayne_Beck ,

 

One of the ways to set a default selection for select input widget is as shown below:

  • Create an Application Parameter by clicking + next to Application Parameters. The app param value is a JSON formatted array. For example.
    • [{"val":" l-Creo 3D - Figure 1.pvi"},{"val":" l-Creo 3D – Figure 2.pvi"}] Screenshot_13.png

       

  • The object attribute name val must be specified in the Value Field and Display Field properties of the Select widget.
  • The app param is then bound to the List property of the Select widget. This binding has a filter on it with the following expression:
    • return angular.fromJson(value);Capture.JPG

       

  • Bind the Value property of the Select widget to the Sequence property of the Model widget
  • Now, put the PVI file name in as the default ‘value’ for the select widget as shown below:Screenshot_12.png

     

Hope this helps!

View solution in original post

5 REPLIES 5
ytella
17-Peridot
(To:Wayne_Beck)

Hi @Wayne_Beck ,

 

One of the ways to set a default selection for select input widget is as shown below:

  • Create an Application Parameter by clicking + next to Application Parameters. The app param value is a JSON formatted array. For example.
    • [{"val":" l-Creo 3D - Figure 1.pvi"},{"val":" l-Creo 3D – Figure 2.pvi"}] Screenshot_13.png

       

  • The object attribute name val must be specified in the Value Field and Display Field properties of the Select widget.
  • The app param is then bound to the List property of the Select widget. This binding has a filter on it with the following expression:
    • return angular.fromJson(value);Capture.JPG

       

  • Bind the Value property of the Select widget to the Sequence property of the Model widget
  • Now, put the PVI file name in as the default ‘value’ for the select widget as shown below:Screenshot_12.png

     

Hope this helps!

Wayne_Beck
12-Amethyst
(To:ytella)

This helped but now I face a few issues.  I would prefer my list not have "l-Creo 3D - Installation Orientation.pvi" in the drop down and just be "Installation Orientation".  Second my play button no longer works to start the sequence.  Any help on this would be great.

ytella
17-Peridot
(To:Wayne_Beck)

Hi @Wayne_Beck,

 

  • To change the display name in the list, update the array in the Application Parameter as follows:
    • [{"val":"l-Creo 3D - ShoulderReplacement.pvi", "name":"ShoulderReplacement"},{"val":"l-Creo 3D - ElbowMotorReplacement.pvi", "name":"ElbowReplacement"}]
    • Now, update the Display filed property of Select widget to name as shown below:Screenshot_14.png

       

  • Drag and Drop a button widget on to the 2D canvas and bind the click event to the PlayAll property of the model widgetScreenshot_15.png

     

 

Wayne_Beck
12-Amethyst
(To:ytella)

Thank you again I now have the list showing correctly.  But I am still unable to get my sequences to play with the button.  

I now have some of the sequences working.

Announcements

Top Tags