First of all don't pull something out of a model and put it into another
model:
item.setDefaultModel(new CompoundPropertyModel(
item.getModelObject() ) );
Do this instead:
item.setDefaultModel(new CompoundPropertyModel( item.getModel() ) );
Perhaps this is the reason: the textfields are showing stale data.
Sven
On 06/28/2013 11:20 AM, always_rick wrote:
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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org