Note that there are some explanatory texts on larger screens.

plurals
  1. POInconsistent Composite Component clientId when using a MethodExpression attribute
    primarykey
    data
    text
    <p>Hi suppose you have the following composite component:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:composite="http://java.sun.com/jsf/composite" &gt; &lt;composite:interface&gt; &lt;composite:attribute name="action" targets="#{cc.clientId}:value"/&gt; &lt;/composite:interface&gt; &lt;composite:implementation&gt; &lt;h1&gt;clientId is: #{cc.clientId}&lt;/h1&gt; &lt;h:commandButton id="value" action="null" value="submit"/&gt; &lt;/composite:implementation&gt; &lt;/html&gt; </code></pre> <p>This composite component simply prints out the <strong>clientId</strong> now if I use this composite component as follows:</p> <pre><code>&lt;h:form id="formID"&gt; &lt;wui:test id="testID"/&gt; &lt;/h:form&gt; </code></pre> <p>What I would expect to have as a result is:</p> <p><strong>clientId is: formID:testID</strong> </p> <p>BUT what I really get is: </p> <p><strong>clientId is: testID</strong></p> <p>Now if I click on the button the form will be submitted and now the result is:</p> <p><strong>clientId is: formID:testID</strong> </p> <p>What is causing the problem is the <strong>action</strong> attribute in the composite interface, if I remove it then the id is always <strong>formID::testID</strong></p> <p>Am I missing something?</p> <hr> <p><strong>Update:</strong></p> <p>I am using Mojarra <strong>javax.faces-2.1.4.jar</strong></p> <hr> <p><strong>Update:</strong></p> <p>I created an issue for the Mojarra team: <a href="http://java.net/jira/browse/JAVASERVERFACES-2278" rel="nofollow">http://java.net/jira/browse/JAVASERVERFACES-2278</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload