You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Matthias Wessendorf <ma...@apache.org> on 2007/07/23 17:17:01 UTC
[Trinidad] NumberConverter
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
--
Matthias Wessendorf
further stuff:
blog: http://matthiaswessendorf.wordpress.com/
mail: matzew-at-apache-dot-org
Re: [Trinidad] NumberConverter
Posted by Gabrielle Crawford <ga...@oracle.com>.
Actually +1 to the original mail. The RI's numberConverter looks like it
returns 0 as well....
Thanks,
Gab
Gabrielle Crawford wrote:
> 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
>>
>>
Re: [Trinidad] NumberConverter
Posted by Gabrielle Crawford <ga...@oracle.com>.
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
>
>