Sven, I forgot.  

code:
-----
ListView listView = new ListView( "users", users ) {

                        @Override
                        protected void populateItem( final ListItem item ) {
                                item.setDefaultModel( 
                                                new CompoundPropertyModel( 
item.getModelObject() ) );
                                item.add( new TextField<String>( "firstName" ) 
);
                                item.add( new TextField<String>( "lastName" ) );

                                item.add( //removeLink( "remove", item ) );
                                              new SubmitLink( "remove", 
item.getModel() ) {
                                                        private static final 
long serialVersionUID = 1L;

                                        @Override
                                        public void onSubmit() {
                                                // copy from ListView > 
removeLink
                                                addStateChange();
                                                item.modelChanging();
                                                getList().remove( 
item.getIndex() );
                                                modelChanged();
                                                removeAll();
                                        }
                                }.setDefaultFormProcessing( false ) );
                        }
}



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/ListView-remove-a-row-by-SubmitLink-always-delete-the-last-one-tp4659796p4659895.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to