cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Johnston <coc...@lojjic.net>
Subject Re: Cforms - fd:initial-value
Date Mon, 27 Feb 2006 02:04:19 GMT
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?

Hmm, bummer.  I looked in my code where I thought I was using this and
that line is commented out with a FIXME comment, so I guess I never got
it working.  This looks like a real bug in CForms to me; you should
search Jira[1] to see if it's been reported and if not please open a new
bug report.

In the meantime, you might get the same effect with something like:

<fd:on-create>
  <fd:javascript>
    event.source.setValue(new java.lang.Integer(1));
  </fd:javascript>
</fd:on-create>

--Jason

[1] https://issues.apache.org/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message