Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-4947

<s:decorate /> tag breaks JSF2 f:ajax functionality

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.3.0.BETA1, 2.3.0.Final
    • Fix Version/s: 2.3.1.CR1
    • Component/s: JSF Integration
    • Labels:
    • Environment:

      JBOSS 7.1.1 Final + RichFaces 4.2.0.Final + Seam 2.3.0.Beta1

    • Steps to Reproduce:
      Hide

      Just follow the bug description.

      Show
      Just follow the bug description.

      Description

      The following XHTML page in JSF2 works fine with no issues. Everything the value in the input field is modified, the page is refreshed with AJAX and the value entered in the input field is displayed in the page.

      <h:form id="frm">
      	<s:div id="enclosingDiv">
      		<h:inputText id="myInput" value="#{testtest.text}" styleClass="#{invalid?'error':''}" 
      			required="true" autocomplete="off" maxlength="20">
      			<f:ajax render="enclosingDiv"/>
      		</h:inputText>
      		<div>
      			<h2>The entered value is</h2>
      			<h:outputText value="#{testtest.text}" />
      		</div>
      	</s:div>
      </h:form>
      

      This works fine and it is the expected behavior.

      If the input field is enclosed by a <s:decorate /> tag as following, and exception is thrown and the page is not rendered.

      <h:form id="frm">
      	<s:div id="enclosingDiv">
      		<s:decorate id="myDecorator">
      			<h:inputText id="myInput" value="#{testtest.text}" styleClass="#{invalid?'error':''}" 
      				required="true" autocomplete="off" maxlength="20">
      				<f:ajax render="enclosingDiv"/>
      			</h:inputText>
      		</s:decorate>
      		<div>
      			<h2>The entered value is</h2>
      			<h:outputText value="#{testtest.text}" />
      		</div>
      	</s:div>
      </h:form>
      

      The output is:

      Caused by javax.faces.FacesException with message: "<f:ajax> contains an unknown id 'enclosingDiv' - cannot locate it in the context of the component myInput" 
      	com.sun.faces.renderkit.html_basic.AjaxBehaviorRenderer.getResolvedId(AjaxBehaviorRenderer.java:285)
      	com.sun.faces.renderkit.html_basic.AjaxBehaviorRenderer.appendIds(AjaxBehaviorRenderer.java:272)
      	com.sun.faces.renderkit.html_basic.AjaxBehaviorRenderer.buildAjaxCommand(AjaxBehaviorRenderer.java:214)
      	com.sun.faces.renderkit.html_basic.AjaxBehaviorRenderer.getScript(AjaxBehaviorRenderer.java:86)
      	javax.faces.component.behavior.ClientBehaviorBase.getScript(ClientBehaviorBase.java:103)
      	com.sun.faces.renderkit.RenderKitUtils.getSingleBehaviorHandler(RenderKitUtils.java:1607)
      	com.sun.faces.renderkit.RenderKitUtils.renderHandler(RenderKitUtils.java:1700)
      	com.sun.faces.renderkit.RenderKitUtils.renderOnchange(RenderKitUtils.java:388)
      	com.sun.faces.renderkit.html_basic.TextRenderer.getEndTextToRender(TextRenderer.java:134)
      	com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:170)
      	javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875)
      	org.jboss.seam.ui.util.cdk.RendererBase.renderChild(RendererBase.java:190)
      	org.jboss.seam.ui.util.cdk.RendererBase.renderChildren(RendererBase.java:166)
      	org.jboss.seam.ui.renderkit.DecorateRendererBase.doEncodeChildren(DecorateRendererBase.java:152)
      	org.jboss.seam.ui.util.cdk.RendererBase.encodeChildren(RendererBase.java:92)
      	javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
      	javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779)
      	javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
      	javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
      	javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
      	javax.faces.component.UIComponent.encodeAll(UIComponent.java:1779)
      	javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
      	javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
      	javax.faces.component.UIComponent.encodeAll(UIComponent.java:1782)
      	com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:402)
      	com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:125)
      	org.jboss.seam.jsf.SeamViewHandler.renderView(SeamViewHandler.java:88)
      	javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
      	javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:288)
      	org.apache.myfaces.tomahawk.application.ResourceViewHandlerWrapper.renderView(ResourceViewHandlerWrapper.java:93)
      	com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
      	com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      	com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      

      The addition of the <s:decorate /> tag breaks the AJAX functionality.j

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                manaRH Marek Novotny
                Reporter:
                ciaccia Andrea Martino
              • Votes:
                4 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: