I have an object I'd like to edit via beaneditor. One of the properties is of the Number class.

When I try to display the beaneditor, I get the following error:

Parameter 'translate' of component core/PropertyEditBlocks:numberfield is bound to null. This parameter is not allowed to be null.

When I changed the variable type to Double, everything worked fine.

Does it have anything to do with the fact that Number is an abstract class and cannot be instantiated? In that case, should I provide some sort of a translator or something like that so it uses, Double for example, when editing the value?

有帮助吗?

解决方案

TextField's require a translate parameter. Tapestry has defaults registered for String, Integer, Long etc. Since tapestry can't find a org.apache.tapestry5.FieldTranslator it's complaining.

Solutions:

  1. Use a concrete type instead of Number
  2. Explicitly pass a FieldTranslator to the TextField (eg set the translate parameter)
  3. Register a FieldTranslator for Number (this sounds crazy to me).
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top