myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <plu...@chello.at>
Subject Composite with 2 outputs on 1 attribute
Date Mon, 07 Jul 2014 11:05:57 GMT
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:interface>
  <composite:attribute name="id" required="true"/>
  <composite:attribute name="bean" required="true" type="a.x.Y"/>
</composite:interface>

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

  </span>
</composite:implementation>


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

Mime
View raw message