@ Override protected void preparePaintComponent ( final Request request ) { assertConfigured ( ) ; List beanList = getBeanList ( ) ; List < Integer > used = new ArrayList <> ( ) ; for ( int i = 0 ; i < beanList . size ( ) ; i ++ ) { Object rowData = beanList . get ( i ) ; // Each row has its own context. This is why we can reuse the same // WComponent instance for each row. UIContext rowContext = getRowContext ( rowData , i ) ; // Check the context has not been used for another row Integer subId = ( ( SubUIContext ) rowContext ) . getContextId ( ) ; if ( used . contains ( subId ) ) { Object rowId = ( ( SubUIContext ) rowContext ) . getRowId ( ) ; String msg = "The row context for row id [" + rowId + "] has already been used for another row. " + "Either the row ID is not unique or the row bean has not implemented equals/hashcode " + "or no rowIdBeanProperty set on the repeater that uniquely identifies the row." ; throw new SystemException ( msg ) ; } used . add ( subId ) ; UIContextHolder . pushContext ( rowContext ) ; try { prepareRow ( request , i ) ; } finally { UIContextHolder . popContext ( ) ; } } }
Override preparePaintComponent to prepare each row for painting .