Inconsistent Composite Component clientId when using a MethodExpression attribute

你。 提交于 2019-12-12 19:37:20

问题


Hi suppose you have the following composite component:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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"
>
  <composite:interface>
    <composite:attribute name="action" targets="#{cc.clientId}:value"/>
  </composite:interface>

  <composite:implementation>
    <h1>clientId is: #{cc.clientId}</h1>
    <h:commandButton id="value" action="null" value="submit"/>
  </composite:implementation>

</html>

This composite component simply prints out the clientId now if I use this composite component as follows:

<h:form id="formID">
  <wui:test id="testID"/>
</h:form>

What I would expect to have as a result is:

clientId is: formID:testID

BUT what I really get is:

clientId is: testID

Now if I click on the button the form will be submitted and now the result is:

clientId is: formID:testID

What is causing the problem is the action attribute in the composite interface, if I remove it then the id is always formID::testID

Am I missing something?


Update:

I am using Mojarra javax.faces-2.1.4.jar


Update:

I created an issue for the Mojarra team: http://java.net/jira/browse/JAVASERVERFACES-2278

来源:https://stackoverflow.com/questions/8706376/inconsistent-composite-component-clientid-when-using-a-methodexpression-attribut

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!