+ Start a Discussion

rerender onclick and onkeyup

I have this code, taken from Jeff Douglas' dynamic search page (thanks very much).


      <script type="text/javascript">
      function doSearch() {
 document.getElementById("contributorFname").value, document.getElementById("contributorLname").value, document.getElementById("MOC_Lname").value, document.getElementById("soqlLimitPage").options[document.getElementById("soqlLimitPage").selectedIndex].value // LAST note comma ); } </script> <apex:actionFunction name="searchServer" action="{!runSearch}" rerender="results,debug,errors"> <apex:param name="contributorFname" value="" /> <apex:param name="contributorLname" value="" /> <apex:param name="MOC_Lname" value="" /> <apex:param name="soqlLimitPage" value="" /> </apex:actionFunction>

 If I enter the code from a field using onKeyUp it works fine. The query runs in the controller and the page rerenders and all is good. Life is great.


 If I enter the code from a button using onClick, the query runs in the controller, I can see it in the debug logs. But.. the page does not rerender.


Is there a difference between onClick and onKeyUp? How else can I force the rerender of the results? (I can provide more code if neccessary.)


I am a coder from way back when but a newbie to java, JS, Apex, and VisualForce.


Thanks for any help... Bob






Adding rerender to the CommandButton line caused progress!

          <apex:commandButton onclick="doSearch();" rerender="results" value="Run Search" id="theSearch"/>