protected Object executeEvents ( final EventType _eventType , final TargetMode _targetMode ) throws EFapsException { Object ret = null ; if ( this . fieldId > 0 && getField ( ) . hasEvents ( _eventType ) ) { final List < EventDefinition > events = getField ( ) . getEvents ( _eventType ) ; final StringBuilder html = new StringBuilder ( ) ; if ( events != null ) { final Parameter parameter = new Parameter ( ) ; parameter . put ( ParameterValues . ACCESSMODE , _targetMode ) ; parameter . put ( ParameterValues . INSTANCE , this . instance ) ; parameter . put ( ParameterValues . CLASS , this . classObject ) ; parameter . put ( ParameterValues . UIOBJECT , this ) ; parameter . put ( ParameterValues . CALL_INSTANCE , getCallInstance ( ) ) ; parameter . put ( ParameterValues . REQUEST_INSTANCES , getRequestInstances ( ) ) ; if ( parameter . get ( ParameterValues . PARAMETERS ) == null ) { parameter . put ( ParameterValues . PARAMETERS , Context . getThreadContext ( ) . getParameters ( ) ) ; } for ( final EventDefinition evenDef : events ) { final Return retu = evenDef . execute ( parameter ) ; if ( retu . get ( ReturnValues . SNIPLETT ) != null ) { html . append ( retu . get ( ReturnValues . SNIPLETT ) ) ; } else if ( retu . get ( ReturnValues . VALUES ) != null ) { ret = retu . get ( ReturnValues . VALUES ) ; if ( retu . get ( ReturnValues . INSTANCE ) != null ) { final Instance inst = ( Instance ) retu . get ( ReturnValues . INSTANCE ) ; if ( inst != null && inst . isValid ( ) ) { setInstance ( inst ) ; } else { setInstance ( null ) ; } } } } } if ( html . length ( ) > 0 ) { ret = html . toString ( ) ; } } return ret ; }
Executes the field value events for a field .