5 Replies Latest reply on Oct 18, 2007 3:12 PM by Clark Updike

    suggestionbox javascript error

    Clark Updike Newbie

      RichFaces 3.0.1, JBoss AS 4.2.1

      The first time I used a suggestionbox, it worked flawlessly. Using the same approach, the second time I get a javascript error:

      this.element has no properties
      Base("pemsForm:pemsItemLookup", "pemsForm:j_id144", Object eventsQueue=pemsForm:j_id144)suggestionbox.js (line 2)
      initialize("_viewRoot", "pemsForm", "pemsForm:pemsItemLookup", "pemsForm:j_id144", null, Object eventsQueue=pemsForm:j_id144)suggestionbox.js (line 53)
      create()org.ajax4jsf.fram... (line 3)
      [Break on this error] if(!RichFaces)var RichFaces={};var Suggestion={};Suggestion.Base=function(){};Su...

      The specific line, referencing "this.element" from suggestionbox.js appears to be:
      if(!RichFaces)var RichFaces={};var Suggestion={};Suggestion.Base=function(){};Suggestion.Base.prototype={baseInitialize:function(element,update,options){this.isOpera=(RichFaces.navigatorType()=="OPERA"?true:false);this.element=$(element);this.update=$(update);this.hasFocus=false;this.changed=false;this.active=false;this.index=0;this.prevIndex=-1;this.entryCount=0;this.keyEvent=false;this.oldValue=this.element.value;var needIframe=(RichFaces.navigatorType()=="MSIE");if(needIframe){options.iframeId=update+"_iframe";}
      

      The xhtml snippet is:
      <h:form id="pemsForm" styleClass="edit">
      
       <s:decorate id="pemsItemLookupDecoration" template="layout/edit.xhtml">
       <ui:define name="label">PEMS Property Number</ui:define>
       <h:inputText id="pemsItemLookup" required="false"
       value="#{passEdit.pemsItemSelection.propertyNum}">
      
       <rich:suggestionbox for="pemsItemLookup"
       suggestionAction="#{passEdit.suggestPemsItem}"
       fetchValue="#{pemsItem.propertyNum}" var="pemsItem">
       <h:column>
       <h:outputText value="#{pemsItem.propertyNum}" />
       </h:column>
       <h:column>
       <h:outputText value="#{pemsItem.manufacturer}" />
       </h:column>
       <h:column>
       <h:outputText value="#{pemsItem.desc}" />
       </h:column>
       </rich:suggestionbox>
      
       </h:inputText>
       </s:decorate>
      
       <a:commandButton value="Add Pems Item" type="submit"
       action="#{passEdit.addPemsItem()}" reRender="passList_pems"/>
      
       </h:form>


      I'm not certain what "this.element" is supposed to refer to or why it is null. The backing bean passEdit.suggestPemsItem method is never called.

      TIA, Clark

        • 1. Re: suggestionbox javascript error
          Ilya Shaikovsky Master

          Could you please check it at least at 3.1.1 GA?

          • 2. Re: suggestionbox javascript error
            Clark Updike Newbie

            Unfortunately 3.1.1.GA produced essentially the same result:

            this.element has no properties
            Base("pemsForm:pemsItemLookupDecoration:pemsItemLookup", "pemsForm:pemsItemLookupDecoration:j_id144", Object)suggestionbox.js (line 2)
            initialize("_viewRoot", "pemsForm", "pemsForm:pemsItemLookupDecoration:pemsItemLookup", "pemsForm:pemsItemLookupDecoration:j_id144", null, Object)suggestionbox.js (line 68)
            create()a4j_3_1_1-SNAPSHO... (line 3)
            [Break on this error] if(!window.RichFaces)window.RichFaces={};var Suggestion={};Suggestion.Base=funct...
            

            and
            if(!window.RichFaces)window.RichFaces={};var Suggestion={};Suggestion.Base=function(){};Suggestion.Base.prototype={baseInitialize:function(element,update,options){this.isOpera=(RichFaces.navigatorType()=="OPERA"?true:false);this.element=$(element);this.update=$(update);this.hasFocus=false;this.changed=false;this.active=false;this.index=0;this.prevIndex=-1;this.entryCount=0;this.keyEvent=false;this.oldValue=this.element.value;this.skipHover=false;var needIframe=(RichFaces.navigatorType()=="MSIE");if(needIframe){options.iframeId=update+"_iframe";}

            Is there anything else I can try?

            • 3. Re: suggestionbox javascript error
              Sergey Smirnov Master

              What is JSF implementation ?

              • 4. Re: suggestionbox javascript error
                Clark Updike Newbie

                The default you get with Seam 2.0.0.CR:

                Manifest-Version: 1.0
                Ant-Version: Apache Ant 1.6.5
                Created-By: 1.5.0_04-b05 (Sun Microsystems Inc.)
                Specification-Title: JavaServer Faces
                Specification-Version: 1.2MR1
                Implementation-Title: Sun Microsystems JavaServer Faces Implementation
                Implementation-Version: 1.2_04-b16-p02
                Implementation-Vendor: Sun Microsystems, Inc.
                Implementation-Vendor-Id: com.sun
                Extension-Name: com.sun.faces

                • 5. Re: suggestionbox javascript error
                  Clark Updike Newbie

                  Is there any suggestion as to what I can try next? Should I file a bug report or what?

                  -Clark