cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <u....@cbim.it>
Subject Re: [cforms] refactoring questions (was Re: cvs commit: cocoon-2.1/src/blocks/forms/java/org/apache/cocoon/forms/formmodel Struct.java Messages.java Repeater.java MultiValueField.java AbstractContainerWidget.java Output.java Upload.java Action.java Form.java ContainerDelegate.java AbstractWidget.java Field.java Union.java BooleanField.java Widget.java)
Date Wed, 21 Apr 2004 08:09:33 GMT
Marc Portier wrote:
> 3/ can getId() ever return null or "" on a widget instance? Can't we 
> carefully asume programming error and allow for the accidental NPE to be 
> thrown

if (id == null || id.equals("")) {
   throw new FormsConfigurationException("Widget id cannot be null.");
}

where FormsConfigurationException extends RuntimeException, of course ;-).

> 7/ should validation stop as soon as possible or continue to allow all 
> validation errors to be set?

If you can't make it optional, allow it to continue.

	Ugo


Mime
View raw message