PDA

View Full Version : Form binding / update model



tsegismont
2 Apr 2009, 1:22 AM
Hi All,

I'm currently working on an CRUD screen divided in three parts: filter (search), grid (result), form (edit).

I've added a store binding to link grid records and form values.

It works as expected (see source code com.extjs.gxt.ui.client.binding.FieldBinding): when a form field fires the change event (on blur), the grid's updated.

But I'd like to let the grid be updated only if:
the form is valid;
the user has clicked an update button.I've been searching the forums but found no similar use case.

Do you think my only option is to extend FieldBinding and override onFieldChange ?



package mypackage;

import com.extjs.gxt.ui.client.binding.FieldBinding;

public class MyFieldBinding extends FieldBinding {

protected void onFieldChange(FieldEvent e) {
// Do not update model immediatly
}

}


Thanks !