public void renderBadUpdateScript ( final FacesContext context ) { final String widgetVar = resolveWidgetVar ( ) ; final String invalidValue = getInvalidDataValue ( ) ; StringBuilder sb = new StringBuilder ( "PF('" + widgetVar + "')" ) ; sb . append ( ".cfg.errors=" ) ; sb . append ( invalidValue ) ; sb . append ( ";" ) ; sb . append ( "PF('" + widgetVar + "')" ) ; sb . append ( ".ht.render();" ) ; PrimeFaces . current ( ) . executeScript ( sb . toString ( ) ) ; sb = new StringBuilder ( ) ; sb . append ( "PF('" ) . append ( widgetVar ) . append ( "')" ) ; sb . append ( ".sheetDiv.removeClass('ui-state-error')" ) ; if ( ! getInvalidUpdates ( ) . isEmpty ( ) ) { sb . append ( ".addClass('ui-state-error')" ) ; } PrimeFaces . current ( ) . executeScript ( sb . toString ( ) ) ; }
Adds eval scripts to update the bad data array in the sheet to render validation failures produced by the most recent ajax update attempt .