cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bart Molenkamp" <b.molenk...@bizzdesign.nl>
Subject [CForms] Plain convertor for Enum datatype is null, throws NPE for MultiValueFields
Date Mon, 13 Jun 2005 09:41:35 GMT
Hi,

I have a multi-value field widget, with datatype enum (so that users can
select 0 or more values from an enum). But, when I load my object model
in the form (setting the enum values from my model into the formmodel),
then show the form, I get a NullPointerException in
MultiValueField.generateItemSaxFragment, line 135.

It tries to use the plain convertor from the Enum datatype. But this
plain convertor is null, because in the EnumTypeBuilder, line 80, it
tries to build the plain convertor:

plainConvertor = plainConvertorBuilder.build(null);

The builder is an EnumConvertorBuilder, which always returns null,
because the argument to build is always null:

public Convertor build(Element configElement) throws Exception {
  if (configElement == null) {
    return null;
  }

...

Is this correct, or is it a bug?

I think that the multi-value widget shouldn't use the plain convertor,
but the convertor defined in the datatype definition of the widget. That
contains the correct convertor widget. It could fall-back to the plain
convertor if the datatype's convertor is null.

Thanks,
Bart


Mime
View raw message