Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    User confirmation on ListGrid edit.

    1. SmartClient Version: v8.2p_2012-09-17/Pro Deployment (built 2012-09-17)

    2. Firefox 15.0

    Im trying to create a user confirmation when exiting edit mode in a ListGrid, but when I prompt the user with either SC.say or SC.confirm, the edit mode is ended and the row is saved, event though im still inside onEditorExit or onRowEditorExit.

    Example:
    Code:
    listGrid.addEditorExitHandler(new EditorExitHandler() {
    	@Override
    	public void onEditorExit(EditorExitEvent event) {
    		SC.confirm("Message", new BooleanCallback() {
    			@Override
    			public void execute(Boolean value) {
    				if(value == null)
    					listGrid.discardAllEdits();
    			}
    		});
    	}
    });
    Or:
    Code:
    listGrid.addRowEditorExitHandler(new RowEditorExitHandler() {
    	@Override
    	public void onRowEditorExit(final RowEditorExitEvent event) {
    		if(event.getNewValues().containsKey("tag"))
    		{
    			SC.ask("Message", new BooleanCallback() {
    				@Override
    				public void execute(Boolean value) {
    					if(!value)
    						event.cancel();
    				}
    			});
    		}
    	}
    });
    Is this the intended behavior, and if so, how can I create some kind of confirmation before the row is saved?

    /Tilds

    #2
    Saving is triggered because keyboard focus left the cell (and went to the modal dialog).

    To prevent this, turn off automatic saving (autoSaveEdits:false) and save manually. See the Grid Editing overview for more background.

    Comment

    Working...
    X