This behavior of getMaxIntegerDigits seems wrong, shouldn't we be
calling the version of resolveInteger that takes a default value?
Thanks,
Gabrielle
Matthias Wessendorf wrote:
Hi,
I am working on the client side NumberConverter, therefore I'd like to
change four methods in the Trinidad API
(org.apache.myfaces.trinidad.convert.NumberConverter)
In order to send down the attributes of maxIntegerDigits,
maxFractionDigits,... I need to check if they have been set on the
tag.
getMaxIntegerDigit() (for instance) returns 0, when not set, because
of this:
@Override
public int getMaxIntegerDigits()
{
Object value = _facesBean.getProperty(_MAX_INTEGER_DIGITS_KEY);
return ComponentUtils.resolveInteger(value);
}
where "return ComponentUtils.resolveInteger(value);" is returning 0,
incase of value is null.
that's fine, but not useful ;-)
Internally the getAsString also checks if the maxIntegerDigits,
maxFractionDigits,... have been set.
The use private methods for this, like:
private boolean _maxIntegerDigitsSpecified()
So...... I'd like to make them protected and would like to rename them to
isMaxIntegerDigitsSet()
that would allow me to check in the IMPL NumberConverter
(org.apache.myfaces.trinidadinternal.convert.NumberConverter) if those
values have been set. and I could use their values to send them down,
if specified.
Is that OK for you guys?
-Matthias