Skip to main content
1-Visitor
June 2, 2017
Question

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

15-Moonstone
June 2, 2017

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?

Translate
fgrondin1-VisitorAuthor
1-Visitor
June 7, 2017

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.

Translate