[JBoss JIRA] (JBSEAM-4947) <s:decorate /> tag breaks JSF2 f:ajax functionality
by Andrea Martino (JIRA)
Andrea Martino created JBSEAM-4947:
--------------------------------------
Summary: <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
Environment: JBOSS 7.1.1 Final + RichFaces 4.2.0.Final + Seam 2.3.0.Beta1
Reporter: Andrea Martino
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: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 1 month
[JBoss JIRA] Created: (SEAMCONFIG-48) EAR contained WAR's beans.xml not processed
by Mike Mosiewicz (JIRA)
EAR contained WAR's beans.xml not processed
-------------------------------------------
Key: SEAMCONFIG-48
URL: https://issues.jboss.org/browse/SEAMCONFIG-48
Project: Seam Config
Issue Type: Bug
Affects Versions: 3.0.0.Final
Environment: JBoss AS 7
Reporter: Mike Mosiewicz
Assignee: Stuart Douglas
I have the EAR app containing one ejb jar and one war. I placed seam-config.jar in EAR's lib directory. My beans.xml are discovered by weld as follows:
15:21:36,588 DEBUG [org.jboss.weld] (MSC service thread 1-3) Found beans.xml: "/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/mongodb-seam-0.0.1-SNAPSHOT.jar/META-INF/beans.xml"
15:21:36,591 DEBUG [org.jboss.weld] (MSC service thread 1-3) Found beans.xml: "/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/seam-persistence-api-3.0.0.Final.jar/META-INF/beans.xml"
15:21:36,592 DEBUG [org.jboss.weld] (MSC service thread 1-3) Found beans.xml: "/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/seam-security-api-3.0.0.Final.jar/META-INF/beans.xml"
15:21:36,594 DEBUG [org.jboss.weld] (MSC service thread 1-3) Found beans.xml: "/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/seam-servlet-3.0.0.Final.jar/META-INF/beans.xml"
15:21:36,597 DEBUG [org.jboss.weld] (MSC service thread 1-3) Found beans.xml: "/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/seam-solder-3.0.0.Final.jar/META-INF/beans.xml"
15:21:36,601 DEBUG [org.jboss.weld] (MSC service thread 1-3) Found beans.xml: "/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/commerce-ejb-0.0.1-SNAPSHOT.jar/META-INF/beans.xml"
15:21:36,603 DEBUG [org.jboss.weld] (MSC service thread 1-11) Found beans.xml: "/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/public-war.war/WEB-INF/beans.xml"
It seems that for ejb and other library jars the extension is executed but not for war. Like this:
15:21:54,173 INFO [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-10) Reading XML file: vfs:/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/seam-security-api-3.0.0.Final.jar/META-INF/beans.xml
15:21:54,177 INFO [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-10) Reading XML file: vfs:/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/commerce-ejb-0.0.1-SNAPSHOT.jar/META-INF/beans.xml
15:21:54,195 INFO [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-10) Reading XML file: vfs:/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/seam-servlet-3.0.0.Final.jar/META-INF/beans.xml
15:21:54,196 INFO [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-10) Reading XML file: vfs:/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/mongodb-seam-0.0.1-SNAPSHOT.jar/META-INF/beans.xml
15:21:54,197 INFO [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-10) Reading XML file: vfs:/C:/servers/jboss-as-web-7.0.0.Final/standalone/deployments/laura.ear/lib/seam-solder-3.0.0.Final.jar/META-INF/beans.xml
15:21:54,204 INFO [org.jboss.seam.config.xml.bootstrap.XmlConfigExtension] (MSC service thread 1-10) Adding XML Defined Bean: pl.proinet.seam.mongo.MongoResolver
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (JBSEAM-4728) NPE involving o.j.s.mock.AbstractSeamTest.Request.init() and o.j.s.ui.facelet.RendererRequest.cleanup()
by Flavio Costa (JIRA)
NPE involving o.j.s.mock.AbstractSeamTest.Request.init() and o.j.s.ui.facelet.RendererRequest.cleanup()
-------------------------------------------------------------------------------------------------------
Key: JBSEAM-4728
URL: https://jira.jboss.org/browse/JBSEAM-4728
Project: Seam
Issue Type: Bug
Components: Mail, Test Harness
Affects Versions: 2.2.0.GA
Environment: java version "1.6.0_22"
Seam 2.2.0.GA
Reporter: Flavio Costa
Assignee: Pete Muir
I'm trying to come up with a solution to integrate Wiser (http://code.google.com/p/subethasmtp/wiki/Wiser) and Seam Mail (so that I can create tests asserting that the e-mail is actually sent) but I stumbled into a problem.
Seam Mail uses the "o.j.s.ui.facelet.RendererRequest" which sets up some mock objects to be able to render a XHTML in a String and send the e-mail.
This works fine in production, I can call it several times during a single request. It works like a charm.
The problems happens when trying to test the given method using SeamTest and its infrastructure.
What happens is, during o.j.s.mock.AbstractSeamTest.Request.init() it creates a new MockFacesContext and saves it so that whenever you call FacesContext.getInstance() or MockFacesContextFactory.getFacesContext() this same instance will be returned.
That's ok... for now.
Things get messier now.
Below code is extracted from RendererRequest.init()
.....
originalFacesContext = FacesContext.getCurrentInstance();
facesContext = RendererFacesContextFactory.instance().getFacesContext(request, response);
....
Problem here is that, due to AbstractSeamTest.Request.init() 'originalFacesContext == facesContext' and when RendererRequest.cleanup() is eventually called 'facesContext.release()' what happens is:
(Extracted from MockFacesContext.release())
setCurrentInstance(null);
MockFacesContextFactory.setFacesContext(null);
The next time someone calls MockFacesContext.getInstance() or MockFacesContextFactory.getFacesContext() they will return null and eventually this will result in a NPE.
Which is exactly what happens with me due to the fact that I call "Renderer.instance().render("mail.xhtml")" multiple times inside a method.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (JBSEAM-4654) s:selectItems noSelectionLabel does not generate option value
by Andrew Wheeler (JIRA)
s:selectItems noSelectionLabel does not generate option value
-------------------------------------------------------------
Key: JBSEAM-4654
URL: https://jira.jboss.org/browse/JBSEAM-4654
Project: Seam
Issue Type: Bug
Components: Core
Affects Versions: 2.2.1.CR1
Environment: JBoss 6 M3
Reporter: Andrew Wheeler
When a selectOneMenu has no items other than the no selection option it does not render the option value as org.jboss.seam.ui.NoSelectionConverter.noSelectionValue. In this case the there are no values in person.images.
<h:selectOneMenu id="portrait" value="#{person.portrait}">
<s:selectItems value="#{person.images}" var="i" label="#{i.annotation}" hideNoSelectionLabel="false" noSelectionLabel="Select a portrait..."/>
<s:convertEntity/>
</h:selectOneMenu>
This renders:
<select id="person:portraitDecoration:portrait" name="person:portraitDecoration:portrait" size="1"> <option selected="selected">Select a portrait...</option>
</select>
The result is that any form submit causes a java.lang.NumberFormatException with message: "For input string: "Select a portrait...""
I have debugged a little and I can see that the converter is not firing when rendering the page. It does however fire for other selectOneMenu items on the page that have one or more items.
A similar and perhaps related issue is referenced in the JBoss Forum.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months