2 Replies Latest reply on Jun 7, 2017 4:28 PM by fgrondin RSS
    fgrondin Explorer

    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', [] );
    
    };
    

     

      • Re: List Custom addition
        mnowaczyk Explorer

        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?

          • Re: List Custom addition
            fgrondin Explorer

            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.