-
1. Re: Nested Composite Components JSF Bug in 7.1.1.Final
ssilvert Mar 13, 2012 9:31 AM (in response to elfuhrer)What version were you on before AS 7.1.1? Was it AS 7.1.0?
If it worked in an earlier version and there were no changes before moving to 7.1.1 then that probalby eliminates a config problem. So it's either a regression in Mojarra 2.1.7 or it's a problem with the JBoss fork. At this point I'm betting on a regression.
Do you have a simple app that reproduces the problem? If so, I can take a look and at least determine if the problem is Mojarra or the fork.
Stan
-
2. Re: Nested Composite Components JSF Bug in 7.1.1.Final
elfuhrer Mar 13, 2012 9:42 AM (in response to ssilvert)Stan it's a regression I bet, I did a workaround to use composite:facets, an ugly approach but works.
Here's a sample example that illlustrates a simple app.
component one in resources/lib/greet1.xhtml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:composite="http://java.sun.com/jsf/composite">
<composite:interface>
<composite:attribute name="name" required="true" />
</composite:interface>
<composite:implementation>
<h:outputText value="Hello #{cc.attrs.name}" />
</composite:implementation>
</html>
and here's another component we'll call it greet2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:composite="http://java.sun.com/jsf/composite">
<composite:interface>
<composite:attribute name="name" required="true" />
</composite:interface>
<composite:implementation>
<h:outputText value="Hello #{cc.attrs.name}" />
</composite:implementation>
</html>
And a third component using them both:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:vcs="http://java.sun.com/jsf/composite/vcs">
<composite:interface>
<composite:facet name="greet1"/>
<composite:facet name="greet2"/>
</composite:interface>
<composite:implementation>
Some bla bla bla goes in here
<div>
<lib:greet1 name="Stan" />
</div>
<div>
<lib:greet2 date="today" />
</div>
</composite:implementation>
</html>
This component fails
Now a component that works is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:vcs="http://java.sun.com/jsf/composite/vcs">
<composite:interface>
<composite:facet name="greet1"/>
<composite:facet name="greet2"/>
</composite:interface>
<composite:implementation>
Some bla bla bla goes in here
<div>
<composite:renderFacet name="greet1"/>
</div>
<div>
<composite:renderFacet name="greet2"/>
</div>
</composite:implementation>
</html>
and then instead of invoking
<lib:greet name="Stan" date="today" />
You would use
<lib:greet>
<f:facet name="greet1">
<lib:greet1 name="alfonse" />
</f:facet>
<br />
<f:facet name="greet2">
<lib:greet2 date="today" />
</f:facet>
</lib:greet>
I have no clue what's wrong with Mojarra, didn't have the time to check the code yet.
Cheers Stan,
-
3. Re: Nested Composite Components JSF Bug in 7.1.1.Final
ssilvert Mar 13, 2012 11:29 AM (in response to elfuhrer)Which version did you use before 7.1.1 that worked?
Stan
-
4. Re: Nested Composite Components JSF Bug in 7.1.1.Final
elfuhrer Mar 13, 2012 11:47 AM (in response to ssilvert)JBoss 7.1.0.Final was ok
-
5. Re: Nested Composite Components JSF Bug in 7.1.1.Final
ssilvert Mar 13, 2012 3:17 PM (in response to elfuhrer)I created an app to test nested composites based on your code. It works just fine. Maybe you are doing something different. Unzip, mvn install, deploy, and hit http://localhost:8080/composite-1.0-SNAPSHOT/index.jsf.
Stan
-
composite.zip 7.7 KB
-
-
6. Re: Nested Composite Components JSF Bug in 7.1.1.Final
elfuhrer Mar 13, 2012 7:01 PM (in response to ssilvert)Thanks Stan, my component had a missing <composite:facet declaration>
Cheers,
Fady
-
7. Re: Nested Composite Components JSF Bug in 7.1.1.Final
elfuhrer Mar 24, 2012 7:06 AM (in response to elfuhrer)Stan, this is a confirmed bug
The composite components are working for a plain simple scenario but when the component gets bigger the same issue happens again.
What I did is that I kept my component implementation intact, and replaced jsf-impl-2.1.7-jbossorg-2.jar with javax.faces-2.1.7.jar and the error is no longer there, the component works flawlessly, probably it's time for 7.1.1.SP1 patch?
-
8. Re: Nested Composite Components JSF Bug in 7.1.1.Final
ssilvert Mar 24, 2012 10:14 AM (in response to elfuhrer)OK. Please open a jira and attach a simple app the recreates the problem.
https://issues.jboss.org/browse/AS7
If you set the component to JSF then it should auto-assign to me, but go ahead and paste the link here just in case.
Thanks,
Stan
-
9. Re: Nested Composite Components JSF Bug in 7.1.1.Final
devinderpal Apr 2, 2012 10:18 AM (in response to ssilvert)Have anyone created a issue for this?
If yes, please attach the link in this post.
-
10. Re: Nested Composite Components JSF Bug in 7.1.1.Final
devinderpal Apr 2, 2012 4:44 PM (in response to devinderpal)created a issue for this:
-
11. Re: Nested Composite Components JSF Bug in 7.1.1.Final
ssilvert Apr 2, 2012 4:53 PM (in response to devinderpal)Hi Devinder,
Please provide a sample app that demonstrates the problem.
Thanks,
Stan
-
12. Re: Nested Composite Components JSF Bug in 7.1.1.Final
elfuhrer Apr 3, 2012 2:24 AM (in response to ssilvert)Here's a snapshot that reproduces the problem
cheers,
fady
-
composite.zip 7.8 KB
-
-
13. Re: Nested Composite Components JSF Bug in 7.1.1.Final
tiagowanke May 7, 2012 9:20 AM (in response to elfuhrer)Is there any news about this problem?
If i choose a different mojarra version will work?
-
14. Re: Nested Composite Components JSF Bug in 7.1.1.Final
yangju May 23, 2012 3:38 PM (in response to elfuhrer)I had same problem with EAP 6 beta2. I had to downgrade jsf-impl version to an older one and then the composite component worked.
Definitely need a fix for the EAP 6 GA.