[
https://issues.jboss.org/browse/JBSEAM-4947?page=com.atlassian.jira.plugi...
]
Andrea Martino commented on JBSEAM-4947:
----------------------------------------
Hi Vaclav, thanks for your answer. It it clear to me how the findComponent works, it is
just not clear why UIDecorate implements NamingContainer. It looks like that only
components like trees, forms and datalists implement this interface, it is not clear to me
why UIDecorator needs it. Everything would work even when UIDecorator would not implement
NamingContainer, just the name of the children would not contain the name of the enclosing
decorator.
<s:decorate /> tag breaks JSF2 f:ajax functionality
---------------------------------------------------
Key: JBSEAM-4947
URL:
https://issues.jboss.org/browse/JBSEAM-4947
Project: Seam 2
Issue Type: Bug
Components: JSF Integration
Affects Versions: 2.3.0.BETA1, 2.3.0.Final
Environment: JBOSS 7.1.1 Final + RichFaces 4.2.0.Final + Seam 2.3.0.Beta1
Reporter: Andrea Martino
Labels: jsf21, starter, taglib
Fix For: 2.3.1.CR1
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.
{code:xml:title=Working JSF}
<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>
{code}
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.
{code:xml:title=Not working JSF}
<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>
{code}
The output is:
{noformat}
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)
{noformat}
The addition of the <s:decorate /> tag breaks the AJAX functionality.j
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira