cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <va...@reverycodes.com>
Subject Re: [Cforms] Java Selection List
Date Thu, 16 Jun 2005 15:05:33 GMT
Bruno Dumon wrote:
> On Thu, 2005-06-16 at 10:51 +0200, Ron van de Ven wrote:
> 
>>I have to set a selection list on a field, based on success or failure
>>of a validation.
>> 
>>When I use the following fragment:
>> 
>>  TntCformsJavaSelectionList mySelectionList = new
>>TntCformsJavaSelectionList(true);
>>  mySelectionList.setDatatype(new StringType());
>>  myField.setSelectionList(mySelectionList);
>> 
>>I get an error: Tried to assign a SelectionList that is not associated
>>with this widget's datatype.
> 
> 
> then why not do:
> 
> mySelectionList.setDatatype(myField.getDatatype());
> 
> ?

I think I had similar situation, with this answer to the question above: you may 
want to share potentially large selection list(s) between multiple widgets, here 
widgets might be on the same form, or even on multiple forms for multiple users. 
It could be quite substantial memory savings... In this scenario, you need 
either multiple widgets have same instance of datatype on multiple widgets (is 
it even possible?), or use equals() instead of '==' as was suggested.

Vadim

Mime
View raw message