Hi Kamal,
the default value is parsed by the convertor. AFAIK the default
convertor for the integer datatype is the formatting convertor, it
obtains a number formatter in the normal java way, calling
NumberFormat.getNumberInstance(locale). So if you get a null pointer
exception maybe is because this method requiring a locale (javadocs does
not specify, but it creates a DecimalFormaSymbols with the given locale,
and that throws a null pointer exception). You should give the locale
you use while typing the fd:initial-value, for example :
<fd:initial-value locale="it">1.000</fd:initial-value>
is a valid one thousand initial value, because in italy we separate
thousands with a dot. Otherwise you can specify a plain convertor (since
the plain convertor does not care about locales), but this will impact
also on the format the field will have while displaying it or parsing it
from the user.
<fd:datatype base="integer">
<fd:convertor type="plain"/>
</fd:datatype>
Simone
Kamal Bhatt wrote:
Jason Johnston wrote:
Kamal Bhatt wrote:
Hi
I have a field of datatype integer, I want set an initial value like
so:
<fd:initial-value>1</fd:initial-value>
This is perfectly legitimate in regards to the validation. However,
when
I do this, I get null pointer exceptions on the line where I create the
form, ie
var form = new Form("cforms/promotion.xml");
What am I doing wrong?
This sounds familiar, I think I ran into it before... I think the
workaround was to specify a locale="" attribute.
Thanks for the reply, but that doesn't seem to be the answer. Do I
need a convertor for this to work?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]