1 Reply Latest reply on Jan 29, 2008 10:32 AM by hispeedsurfer

    clear selectedClass

    hispeedsurfer

      Hi,

      is there a way to clear the selected row (selectedClass) per javascript?
      In some cases I select a 'thing' outside the scrollableTable so I have to clear the colored row in the table.


      thanks

        • 1. Re: clear selectedClass
          hispeedsurfer

          Not the best way, but one way..

          <a:jsFunction name="clearRowSelection"
           data="#{reportDisplay.currentRowNumber}"
           oncomplete="clearRowSelectionDelegation(data)"
           immediate="true"/>


          here the bean method where current is the selected entity
          public int getcurrentRowNumber(){
           return resultList.indexOf(current);
          }


          and the javascript function
          function function clearRowSelectionDelegation(currentRow){
           var row = document.getElementById('resultTableForm:shortQueryResult:n:' +currentRow);
           row.style.backgroundColor = '#FFFFFF';
           row.style.color ='#000000';
          }