@ Override protected void preparePaintComponent ( final Request request ) { super . preparePaintComponent ( request ) ; List < AjaxTarget > targets = getTargets ( ) ; if ( targets != null && ! targets . isEmpty ( ) ) { WComponent triggerComponent = trigger == null ? this : trigger ; // The trigger maybe in a different context UIContext triggerContext = WebUtilities . getContextForComponent ( triggerComponent ) ; UIContextHolder . pushContext ( triggerContext ) ; // TODO The IDs of the targets are based on the Triggers Context. Not good for targets in repeaters try { List < String > targetIds = new ArrayList <> ( ) ; for ( AjaxTarget target : getTargets ( ) ) { targetIds . add ( target . getId ( ) ) ; } AjaxHelper . registerComponents ( targetIds , triggerComponent . getId ( ) ) ; } finally { UIContextHolder . popContext ( ) ; } } }
Override preparePaintComponent in order to register the components for the current request .