5 Replies Latest reply on Jun 21, 2007 9:15 AM by Yannick Lazzari

    RichFaces 3.0.1 suggestionBox javascript error

    Yannick Lazzari Newbie

      Hi all,

      I just upgraded from the snapshots of RichFaces 3.0.1 and Ajax4jsf 1.1.1 to the official releases and now I have a weird javascript error when using suggestionBox. I have the following javascript error when I load my facelet template, "RichFaces.Suggestion is not a constructor".

      Here is the javascript that is generated at runtime:

      //<![CDATA[
      new RichFaces.Suggestion('_viewRoot','j_id69:prescribingForm','j_id69:prescribingForm:drugSearchCriteria','j_id69:prescribingForm:j_id91',null,{'minChars':'3','param':'inputvalue','select':'richfaces_suggestionSelectValue','width':'500','frequency':4.9E-324,'eventsQueue':'j_id69:prescribingForm:j_id91','entryClass':'richfaces_suggestionEntry','rows':0,'height':'200','onselect':function(suggestion,event){A4J.AJAX.Submit('_viewRoot','j_id69:prescribingForm',event,{'parameters':{'j_id69:prescribingForm:j_id91:j_id92':'j_id69:prescribingForm:j_id91:j_id92'} ,'actionUrl':'/moxxi-prototype/views/patient/editPatient.seam'} )},'popup':'j_id69:prescribingForm:j_id91','parameters':{'j_id69:prescribingForm:j_id91':'j_id69:prescribingForm:j_id91'} ,'actionUrl':'/moxxi-prototype/views/patient/editPatient.seam','requestDelay':500} );
      //]]>
      


      Here is the snippet of my facelet template that uses the suggestionBox:
      <h:inputText id="drugSearchCriteria" size="50" value="#{editPatientController.drugSearchCriteria}" autocomplete="off"/>
      <rich:suggestionbox for="drugSearchCriteria" height="200" width="500" suggestionAction="#{editPatientController.suggestDrug}" var="drug" fetchValue="#{drug.fullDescription}" requestDelay="500" minChars="3" ajaxSingle="true">
       <a4j:support event="onselect" action="#{editPatientController.onDrugSelected}" reRender="prescriptionPad"/>
       <h:column>
       <h:outputText escape="false" value="#{drug.fullDescriptionHighlighted}"/>
       </h:column>
      </rich:suggestionbox>
      


      This used to work fine with the snaphots. Also note that going from the snapshots to the official release forced me to also upgrade my version of commons-collections to version 3.2. I also upgraded my version of commons-digester from version 1.6 to 1.8.

      Thanks for any help you can provide.