[
https://issues.apache.org/jira/browse/MYFACES-3951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14309414#comment-14309414
]
Leonardo Uribe commented on MYFACES-3951:
-----------------------------------------
I can confirm the problem. It occurs only the first time the composite
component is compiled. The reason is when the algorithm builds the composite
component metadata (process the section inside composite:interface), a
component is added to encapsulate the comment and that component receives an
id, like any other component. But there is some code that once calculated the
metadata, it is reused over and over. This causes a problem with the ids
ordering, so when the view is restored, the id number is not the same.
The solution could be use an special id prefix when composite:interface is
processed (define it as a special section, like c:if does), to avoid the
problem in the id generation.
> Action not performed on first click
> -----------------------------------
>
> Key: MYFACES-3951
> URL: https://issues.apache.org/jira/browse/MYFACES-3951
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 2.2.7
> Reporter: Filipe Antunes
>
> h:commandButton action is not performed when there is one composite component
> with comments on interface section. This only happens in the first click
> after the server starts. The second time the user clicks, the action is
> performed as expected. If we remove the comment from the composite component,
> everything works.
> Test Case:
> Page
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:h="http://xmlns.jcp.org/jsf/html"
> xmlns:vc="http://xmlns.jcp.org/jsf/composite/core">
>
> <h:head>
> <title>JSF 2.2 Composite Component Test Case</title>
> </h:head>
> <h:body>
> <h:form>
> <vc:emptyComponent />
> <h:commandButton value="Execute Action"
> action="#{testBeanCC.printAction}" />
> </h:form>
> </h:body>
> </html>
> Managed Bean
> @ManagedBean(name="testBeanCC")
> @SessionScoped
> public class TestBeanCC {
> public String printAction() {
> System.out.println("action performed");
> return null;
> }
> }
> Composite Component
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:composite="http://xmlns.jcp.org/jsf/composite">
> <composite:interface>
> <composite:attribute name="name"/> <!-- remove this comment to
> make it work -->
> </composite:interface>
>
> <composite:implementation>
>
> </composite:implementation>
> </html>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)