2 Replies Latest reply on Oct 13, 2009 3:44 PM by Kavita Tipnis

    Question listshuttle + suggestionBox

    jules poit Newbie

      Hi everyone

      I have a question
      I am using Richfaces the suggestionbox with a listShuttle. Basically what I want to do is when a user selects/clicks on an item in the suggestionBox that this item is selected in my listShuttle (in the sourceValue list). (Let say I have 1000 values -String - in my listShuttle, then the suggestionBox is used to find quickly an item and focus on it in the listShuttle, it is more convenient than using the scroller of the listShuttle ).

      What I am doing right know, is using a javascript function on the onselect="selectItem();" event of the suggestionBox, so I have :

       function selectItem(){
      
       var sug = document.getElementById('chartSettingsForm:paramInput').value;
       var i = 0;
      
       for(i =0; i< document.getElementById('chartSettingsForm:parametersListShuttletbody').childNodes.length ; i++){
      
       var t = document.getElementById('chartSettingsForm:parametersListShuttletbody').childNodes.textContent;
       if(sug == t){
      
      
       alert(t);
       }
       }
      
       }
      
      



      I am retrieving the good value but I do not know how to "focus" on the element in my list ... I am pretty sure is it simple but I tried, t.select(), t.focus() ... but nothing is working :/

      Thanks for your help