suggestionbox javascript error
cupdike Oct 10, 2007 5:30 PMRichFaces 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