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

List Custom addition

fgrondin
5-Regular Member

List Custom addition

Hi,

I've modified the list to have a service that,when triggered, will reset the selected row to null (for the dropdown).

This is mostly what I have in the Runtime JS.

Now the problem is, it does remove the selected value on the dropdown actual value, But when I open the dropdown the value is still selected.

How would I remove the selectedItem from data ?

this.serviceInvoked = function ( serviceName )

{

    var thisWidget = this;

    switch ( serviceName )

    {

         case 'ClearSelectedItem':

              this.resetData();

         break;

         default:

         TW.log.error( 'Folding Panel widget, unexpected serviceName invoked "' + serviceName + '"' );

    }

};

this.resetData = function ()

{

    var thisWidget = this;

    thisWidget.updateSelection( 'Data', [] );

    thisWidget.clearCurrentValueHtml();

    thisWidget.setProperty( 'SelectedText', undefined );

    thisWidget.updateSelection( 'Data', [] );

};

2 REPLIES 2

Frederic, Looking at the documentation list widget has property SelectedText that is field value that is currently selected and SelectedItems that is defined as infotable field that is currently selected. Have you tried unsetting the SelectedItems instead of SelectedText?

fgrondin
5-Regular Member
(To:MarekP.Nowaczyk)

Hi thank you for recommending this,

I've tried it by adding this line or code (I've tried two way) :

1- thisWidget.setProperty( 'SelectedItems', [] );

2- thisWidget.setProperty( 'SelectedItems', undefined );

None of these lines worked, maybe I'm doing something wrong or maybe selectedItems doesn't work that way.

Top Tags