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

    RichFaces 3.0.1 suggestionBox javascript error

      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.

        • 1. Re: RichFaces 3.0.1 suggestionBox javascript error
          ilya_shaikovsky

          Can't reproduce under 3.0.2 and 1.1.2. Continues nvestigations. I'll make your updates also now.

          • 2. Re: RichFaces 3.0.1 suggestionBox javascript error
            ilya_shaikovsky

            could you please check under 3.0.2 and 1.1.2 snapshots. Still can't see such messages.

            • 3. Re: RichFaces 3.0.1 suggestionBox javascript error

              I will check and let you know. In the meantime, I switched back to the snapshots and it works. Here's the generated javascript:

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


              I guess it is one of the changes between the snapshot and the official release, but you see that in the snapshot, the javascript calls "Exadel.Suggestion" and not "RichFaces.Suggestion". I guess the method was renamed. That might be something to look into.

              • 4. Re: RichFaces 3.0.1 suggestionBox javascript error
                ilya_shaikovsky

                It looks like a cache problem. Try to clear browser cache after you update versions.

                • 5. Re: RichFaces 3.0.1 suggestionBox javascript error

                  That was it. Thanks a lot. I feel like an idiot now.