public void saveEntity(CmsEntity entity, final boolean clearOnSuccess, final Command callback) {

        AsyncCallback<CmsValidationResult> asyncCallback = new AsyncCallback<CmsValidationResult>() {

            public void onFailure(Throwable caught) {

                onRpcError(caught);
            }

            public void onSuccess(CmsValidationResult result) {

                callback.execute();
                if (clearOnSuccess) {
                    destroyForm(true);
                }
            }
        };
        getService().saveEntity(entity, asyncCallback);
    }
public void saveEntity ( CmsEntity entity , final boolean clearOnSuccess , final Command callback ) { AsyncCallback < CmsValidationResult > asyncCallback = new AsyncCallback < CmsValidationResult > ( ) { public void onFailure ( Throwable caught ) { onRpcError ( caught ) ; } public void onSuccess ( CmsValidationResult result ) { callback . execute ( ) ; if ( clearOnSuccess ) { destroyForm ( true ) ; } } } ; getService ( ) . saveEntity ( entity , asyncCallback ) ; }
Saves the given entity.<p>

@param entity the entity
@param clearOnSuccess <code>true</code> to clear all entities from entity back-end on success
@param callback the callback executed on success