protected RepeatingView newRepeatingView ( final String id , final IModel < T > model ) { final RepeatingView fields = new RepeatingView ( "fields" ) ; form . add ( fields ) ; final T modelObject = model . getObject ( ) ; for ( final Field field : modelObject . getClass ( ) . getDeclaredFields ( ) ) { // skip serialVersionUID... if ( field . getName ( ) . equalsIgnoreCase ( "serialVersionUID" ) ) { continue ; } final WebMarkupContainer row = new WebMarkupContainer ( fields . newChildId ( ) ) ; fields . add ( row ) ; final IModel < String > labelModel = Model . of ( field . getName ( ) ) ; row . add ( new Label ( "name" , labelModel ) ) ; final IModel < ? > fieldModel = new PropertyModel < Object > ( modelObject , field . getName ( ) ) ; // Create the editor for the field. row . add ( newEditorForBeanField ( "editor" , field , fieldModel ) ) ; } return fields ; }
Factory method for creating the RepeatingView . This method is invoked in the constructor from the derived classes and can be overridden so users can provide their own version of a RepeatingView .