If you want to use the same values for maxFractionDigits and 
minFractionDigits for every row in the table then there is no
problem, you just need to just need to provide them in a 
variable that exists when the datatable gets created (rowVar
doesn't exist at that time).

If you want to use different values for each row then, you 
can't you f:convertNumber.
You could write your own converted that does the the 
valueBinding when the converter is called instead of
when it is created.

Greg

-----Original Message-----
From: Paul Spencer

Suggested workarounds?

> it is not possible to use the dataTables var object (here "rowVar") in
> converters, because the evaluation of valueBinding in converter
> attributes are done once at creation time, not at rendering time.
> The "rowVar" object did not exist on component crateion time.

>><h:dataTable id="data" value="#{resultData}" var="rowVar" border="1"
>>             style="empty-cells: show;">
>>  <h:column>
>>    <h:outputText value="#{rowVar.targetValue}">
>>      <f:convertNumber type="number" groupingUsed="false"
>>                       minIntegerDigits="1"
>>                       maxFractionDigits="#{rowVar.numberOfDecimals}"
>>                       minFractionDigits="#{rowVar.numberOfDecimals}"
/>
>>      </h:outputText>
>>      <h:outputText value="#{rowVar.numberOfDecimals}" />
>>   </h:column>
>></h:dataTable>

Reply via email to