AjaxUpdate component not found with RF3.3.3 and a4j:support event="onenter"
fabmars Apr 18, 2011 8:54 PMHi
I have an application (listed in the RF in PROD page since a long time) that used RF 3.3.2 on JSF 1.2 and Glassfish 2.1.1.
I am migrating it to GF 3.1 using CDI, etc. I'd lke to upgrade to RF4.0 but that will need some work since some components I used have been removed.
So I tried to make an interim release on RF 3.3.3 in the meantime and restart from there. Of course I have followed the page to make RF 3.3.3 + JSF 2.0 to work together.
And it works fine except one thing. I had this in the past which worked on RF 3.3.2 + JSF 1.2:
<h:form id="productSearchForm"> <rich:panelBar selectedPanel="#{productViewSearch.searchMode}"> <rich:panelBarItem name="categories" label="Categories"> <a4j:support event="onenter" ajaxSingle="true" actionListener="#{productViewSearch.doChangeSearchMode}"/> <h:panelGrid cellspacing="0"> <a4j:commandLink value="Recently added" actionListener="#{productViewSearch.doSearchRecentProducts}" ajaxSingle="true" reRender="productListForm"/> <rich:spacer height="3"/> <a4j:commandLink value="Suntrip Releases" actionListener="#{productViewSearch.doSearchMainProducts}" ajaxSingle="true" reRender="productListForm"/> <rich:spacer height="10"/> <a4j:repeat value="#{catalogLister.availableProductTypes.toList}" var="type"> <h:panelGrid cellspacing="0"> <a4j:commandLink value="#{type.name}" ajaxSingle="true" reRender="productListForm"> <a4j:actionparam name="typeId" value="#{type.id}" assignTo="#{productView.typeId}"/> </a4j:commandLink> </h:panelGrid> </a4j:repeat> </h:panelGrid> </rich:panelBarItem> <rich:panelBarItem name="advanced" label="Advanced Search"> <a4j:support event="onenter" ajaxSingle="true" actionListener="#{productViewSearch.doChangeSearchMode}"/> <!-- and some more stuff --> </h:panelGrid> </rich:panelBarItem> </rich:panelBar>
On RF 3.3.3 + JSF2 I get some error:
GRAVE: Error Rendering View[/public/productList.xhtml] javax.faces.FacesException: javax.faces.FacesException: javax.el.ELException: AjaxUpdate component not found for id: j_id42 at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:2346) at org.richfaces.renderkit.html.PanelBarRendererBase.getScriptPanelBarItems(PanelBarRendererBase.java:140) at org.richfaces.renderkit.html.PanelBarRendererBase.encodeScript(PanelBarRendererBase.java:173) at org.richfaces.renderkit.html.PanelBarRenderer.doEncodeEnd(PanelBarRenderer.java:171) at org.richfaces.renderkit.html.PanelBarRenderer.doEncodeEnd(PanelBarRenderer.java:179) at org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:134) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:281) at org.ajax4jsf.renderkit.html.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:61) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756) at javax.faces.render.Renderer.encodeChildren(Renderer.java:168) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185) at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185) at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:304) at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185) at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:594) at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100) at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:410) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215) at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206) at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388) at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98) at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90) at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79) at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54) at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59) at com.sun.grizzly.ContextTask.run(ContextTask.java:71) at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532) at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513) at java.lang.Thread.run(Thread.java:662) Caused by: javax.faces.FacesException: javax.el.ELException: AjaxUpdate component not found for id: j_id42 at org.richfaces.component.html.HtmlPanelBarItem.getOnenter(HtmlPanelBarItem.java:320) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at javax.faces.component.UIComponentBase$AttributesMap.get(UIComponentBase.java:2338) ... 70 more Caused by: javax.el.ELException: AjaxUpdate component not found for id: j_id42 at org.ajax4jsf.component.EventValueExpression.getComponent(EventValueExpression.java:86) at org.ajax4jsf.component.AbstractEventValueExpression.getValue(AbstractEventValueExpression.java:98) at org.richfaces.component.html.HtmlPanelBarItem.getOnenter(HtmlPanelBarItem.java:318) ... 75 more
Naturally, if I remove the <a4j:support event="onenter" .../> lines, the page displays but without what I had foreseen for the onenter event.
I know RF 3.3.3 may ot be the RF team's priority, but I'd really appreciate some help or a workaround nonetheless.
Thanks.
<rich:panelBar selectedPanel="#{productViewSearch.searchMode}">
<rich:panelBarItem name="categories" label="Categories">
<a4j:support event="onenter" ajaxSingle="true" actionListener="#{productViewSearch.doChangeSearchMode}"/>
<h:panelGrid cellspacing="0">
<a4j:commandLink value="Recently added" actionListener="#{productViewSearch.doSearchRecentProducts}" ajaxSingle="true" reRender="productListForm"/>
<rich:spacer height="3"/>
<a4j:commandLink value="Suntrip Releases" actionListener="#{productViewSearch.doSearchMainProducts}" ajaxSingle="true" reRender="productListForm"/>
<rich:spacer height="10"/>
<a4j:repeat value="#{catalogLister.availableProductTypes.toList}" var="type">
<h:panelGrid cellspacing="0">
<a4j:commandLink value="#{type.name}" ajaxSingle="true" reRender="productListForm">
<a4j:actionparam name="typeId" value="#{type.id}" assignTo="#{productView.typeId}"/>
</a4j:commandLink>
</h:panelGrid>
</a4j:repeat>
</h:panelGrid>
</rich:panelBarItem>
<rich:panelBarItem name="advanced" label="Advanced Search">
<a4j:support event="onenter" ajaxSingle="true" actionListener="#{productViewSearch.doChangeSearchMode}"/>
<h:panelGrid columns="2">
<h:outputLabel value="Search" for="containing"/>
<h:inputText id="containing" label="Containing" value="#{productViewSearch.searchContaining}" size="30" maxlength="30">
<f:validateLength maximum="30"/>
<tw:convertTrimAndClean/>
</h:inputText>
<h:outputLabel value="CatNr/Barcode" for="code"/>
<h:inputText id="code" label="CatNr/Barcode" value="#{productViewSearch.searchCode}" size="15" maxlength="15">
<f:validateLength maximum="15"/>
<tw:convertTrimAndClean/>
</h:inputText>
<h:outputLabel value="Category" for="category"/>
<h:selectOneMenu id="category" label="Category" value="#{productViewSearch.searchCategory}" converter="SelectEnumConverter">
<f:selectItem itemLabel=""/>
<f:selectItems value="#{catalogLister.allProductCategoriesItems}"/>
<a4j:support event="onchange" ajaxSingle="true" reRender="type"/>
<a4j:support event="onkeyup" ajaxSingle="true" reRender="type"/>
</h:selectOneMenu>
<h:outputLabel value="Type" for="type"/>
<h:selectOneMenu id="type" label="Type" value="#{productViewSearch.searchType}" converter="SelectIdentifiableConverter">
<f:selectItem itemLabel=""/>
<f:selectItems value="#{productViewSearch.productTypesForCategoryItems}"/>
</h:selectOneMenu>
<h:outputLabel value="Min price €" for="minPrice"/>
<h:inputText id="minPrice" label="Min price" value="#{productViewSearch.searchMinPrice}" converter="FloatOrNullConverter"/>
<h:outputLabel value="Max price €" for="maxPrice"/>
<h:inputText id="maxPrice" label="Max price" value="#{productViewSearch.searchMaxPrice}" converter="FloatOrNullConverter"/>
<h:commandButton value="Search" actionListener="#{productViewSearch.doSearchProducts}"/>
</h:panelGrid>
</rich:panelBarItem>
</rich:panelBar>