@ Override public void onError ( final AjaxRequestTarget _target ) { final FeedbackCollector collector = new FeedbackCollector ( getForm ( ) . getPage ( ) ) ; final List < FeedbackMessage > msgs = collector . collect ( ) ; final ErrorMessageResource msgResource = new ErrorMessageResource ( ) ; final StringBuilder html = new StringBuilder ( ) . append ( "<table class=\"eFapsValidateFieldValuesTable\">" ) ; for ( final FeedbackMessage msg : msgs ) { if ( ! ( msg . getReporter ( ) instanceof Form ) ) { if ( msg . getReporter ( ) instanceof AutoCompleteComboBox ) { final StringBuilder js = new StringBuilder ( ) . append ( "domClass.add(dom.byId('" ) . append ( msg . getReporter ( ) . getMarkupId ( ) ) . append ( "').parentNode, 'invalid');" ) ; _target . prependJavaScript ( DojoWrapper . require ( js , DojoClasses . dom , DojoClasses . domClass ) ) ; } else { msg . getReporter ( ) . add ( AttributeModifier . append ( "class" , "invalid" ) ) ; _target . add ( msg . getReporter ( ) ) ; } } Serializable warn = null ; if ( msg . getMessage ( ) instanceof ValidationErrorFeedback ) { // look if a message was set warn = ( ( ValidationErrorFeedback ) msg . getMessage ( ) ) . getMessage ( ) ; // still no message, create one if ( warn == null ) { warn = ( ( ValidationErrorFeedback ) msg . getMessage ( ) ) . getError ( ) . getErrorMessage ( msgResource ) ; } } else { warn = String . valueOf ( msg . getMessage ( ) ) ; } html . append ( "<tr>" ) ; if ( msg . getReporter ( ) instanceof IFieldConfig ) { html . append ( "<td>" ) . append ( ( ( IFieldConfig ) msg . getReporter ( ) ) . getFieldConfig ( ) . getLabel ( ) ) . append ( ":</td><td>" ) . append ( warn ) . append ( "</td>" ) ; } else { html . append ( "<td colspan=\"2\">" ) . append ( warn ) . append ( "</td></tr>" ) ; } msg . getReporter ( ) . getFeedbackMessages ( ) . clear ( ) ; } html . append ( "</table>" ) ; showDialog ( _target , html . toString ( ) , true , false ) ; // after every commit the fieldset must be reseted getForm ( ) . getPage ( ) . visitChildren ( SetDataGrid . class , ( _setDataGrid , _visit ) -> { final UIFieldSet fieldSet = ( UIFieldSet ) _setDataGrid . getDefaultModelObject ( ) ; fieldSet . resetIndex ( ) ; } ) ; getForm ( ) . getPage ( ) . visitChildren ( DropDownField . class , ( _dropDown , _visit ) -> ( ( DropDownField ) _dropDown ) . setConverted ( false ) ) ; }
Method is not used but needed from the api .