public void decode ( FacesContext context , UIComponent component , List < String > legalValues , String realEventSourceName ) { InputText inputText = ( InputText ) component ; if ( inputText . isDisabled ( ) || inputText . isReadonly ( ) ) { return ; } decodeBehaviors ( context , inputText ) ; String clientId = inputText . getClientId ( context ) ; String name = inputText . getName ( ) ; if ( realEventSourceName == null ) { realEventSourceName = "input_" + clientId ; } if ( null != inputText . getFieldId ( ) ) { realEventSourceName = inputText . getFieldId ( ) ; } if ( null == name ) { name = "input_" + clientId ; } String submittedValue = ( String ) context . getExternalContext ( ) . getRequestParameterMap ( ) . get ( name ) ; if ( inputText instanceof InputSecret ) { if ( ! ( ( InputSecret ) inputText ) . isRenderValue ( ) ) { if ( "*******" . equals ( submittedValue ) ) { submittedValue = null ; } } } if ( null != legalValues && null != submittedValue ) { boolean found = false ; for ( String option : legalValues ) { found |= submittedValue . equals ( option ) ; } if ( ! found ) { submittedValue = "" ; } } if ( submittedValue != null ) { inputText . setSubmittedValue ( submittedValue ) ; } new AJAXRenderer ( ) . decode ( context , component , realEventSourceName ) ; }
This method is used by RadioButtons and SelectOneMenus to limit the list of legal values . If another value is sent the input field is considered empty . This comes in useful the the back - end attribute is a primitive type like int which doesn t support null values .