myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Schacherl <>
Subject AW: Composite with 2 outputs on 1 attribute
Date Mon, 07 Jul 2014 11:11:33 GMT
AFAIR you'll need to insert <composite:insertChildren /> in the composite component instead
of <f:formatNumber>. When you call your composite component with a <f:convertNumber>
tag as child, it gets inserted at the point where <composite:insertChildren /> occurs
in your composite.


-----Urspr√ľngliche Nachricht-----
Von: [] 
Gesendet: Montag, 7. Juli 2014 13:06
Betreff: Composite with 2 outputs on 1 attribute

I want to build a Composite handling a Bean with 2 members internally:

Bean with Bigdecimal value and String unit 

as Attribute for the Composite:

  <composite:attribute name="id" required="true"/>
  <composite:attribute name="bean" required="true" type="a.x.Y"/> </composite:interface>

  <span id="#{cc.clientId}">
    <h:outputText value="#{cc.attrs.bean.value}" id="value"/>
    <span><h:outputText value="#{cc.attrs.bean.unit}" id="unit"/></span>


This works fine for calling it like

<my:compOut id="beanId" bean="#{bean}"/>

Now I want to specify formatting, which works within the Composite like 

<h:outputText value="#{cc.attrs.bean.value}" id="value">
  <f:convertNumber pattern="#,##0.00" locale="de"/> </h:outputText>

but I want to set it within the calling Facelet:

<my:compOut id="beanId" bean="#{bean}">
  <f:convertNumber pattern="#,##0.00" locale="de"/> </my:compOut>

which does not work. I assume this is since I have no editableValueHolder to refer to.

In the following there schould be an accordingly Input implementation with 2 InputTexts <my:compIn>.

Is there any solution to this (for output and/or input) or ist that combination with composites
simply not possible (and must be coded in a Java-Component)?

Martin Gruschi
View raw message