Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
viewer-wicket-1.6.0
-
None
Description
Entering longer text in the input field for Char type fails with the following exception:
Caused by: org.apache.isis.core.metamodel.facets.object.parseable.InvalidEntryException: Only a single character is required
at org.apache.isis.core.metamodel.facets.value.chars.CharValueSemanticsProviderAbstract.doParse(CharValueSemanticsProviderAbstract.java:53)
at org.apache.isis.core.metamodel.facets.value.chars.CharValueSemanticsProviderAbstract.doParse(CharValueSemanticsProviderAbstract.java:33)
at org.apache.isis.core.metamodel.facets.object.value.vsp.ValueSemanticsProviderAndFacetAbstract.doParse(ValueSemanticsProviderAndFacetAbstract.java:188)
at org.apache.isis.core.metamodel.facets.object.value.vsp.ValueSemanticsProviderAndFacetAbstract.parseTextEntry(ValueSemanticsProviderAndFacetAbstract.java:173)
at org.apache.isis.core.metamodel.facets.object.parseable.parser.ParseableFacetUsingParser.parseTextEntry(ParseableFacetUsingParser.java:88)
at org.apache.isis.viewer.wicket.model.models.ScalarModel.setObjectAsString(ScalarModel.java:573)
at org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldParseableAbstract$1.setObject(ScalarPanelTextFieldParseableAbstract.java:64)
at org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldParseableAbstract$1.setObject(ScalarPanelTextFieldParseableAbstract.java:51)
....
The exception is both logged and shown in the collapsed panel in the content area.
I'd expect that an error feedback error message is shown instead.
Also Wicket StringValidator can be used to set the 'maxlength' HTML5 attribute to prevent entering such invalid data at the client side.