Source:
<code>private void onCreateSession() { final GlusterVolumeGeoRepCreateModel createModel = (GlusterVolumeGeoRepCreateModel) getWindow(); <START> createModel.startProgress(null); <END> final Guid masterVolumeId = getEntity().getId(); final String remoteVolumeName = createModel.getSlaveVolumes().getSelectedItem().getName(); final String remoteHostName = createModel.getSlaveHosts().getSelectedItem(); String remoteUserName = createModel.getSlaveUserName().getEntity(); String remoteUserGroup = createModel.getSlaveUserGroupName().getEntity(); Frontend.getInstance().runAction(VdcActionType.CreateGlusterVolumeGeoRepSession, new GlusterVolumeGeoRepSessionParameters(masterVolumeId, remoteVolumeName, remoteHostName, remoteUserName, remoteUserGroup, !createModel.getShowEligibleVolumes().getEntity()), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { createModel.stopProgress(); if (result.getReturnValue().getSucceeded()) { if (createModel.getStartSession().getEntity()) { Frontend.getInstance().runAction(VdcActionType.StartGlusterVolumeGeoRep, new GlusterVolumeGeoRepSessionParameters(masterVolumeId, remoteVolumeName, remoteHostName), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { closeWindow(); if (!result.getReturnValue().getSucceeded()) { initializeGeoRepActionConfirmation(constants.geoReplicationStartTitle(), HelpTag.volume_geo_rep_start_confirmation, "volume_geo_rep_start_confirmation", constants.geoRepForceHelp(), messages.geoRepForceTitle(constants.startGeoRep()), "onStartGeoRepSession"); final GlusterVolumeGeoRepActionConfirmationModel cModel = (GlusterVolumeGeoRepActionConfirmationModel) getWindow(); cModel.setMessage(result.getReturnValue().getFault().getMessage()); } } }, VolumeGeoRepListModel.this, false); } } else { createModel.setQueryFailureMessage(result.getReturnValue().getFault().getMessage()); } } }, this, false); }</code><technical_language>want validate values filled in ui, atleast null</technical_language>

Target:
private void onCreateSession() { final GlusterVolumeGeoRepCreateModel createModel = (GlusterVolumeGeoRepCreateModel) getWindow(); if (!createModel.validate()) { return; } createModel.startProgress(null); final Guid masterVolumeId = getEntity().getId(); final String remoteVolumeName = createModel.getSlaveVolumes().getSelectedItem().getName(); final String remoteHostName = createModel.getSlaveHosts().getSelectedItem(); String remoteUserName = createModel.getSlaveUserName().getEntity(); String remoteUserGroup = createModel.getSlaveUserGroupName().getEntity(); Frontend.getInstance().runAction(VdcActionType.CreateGlusterVolumeGeoRepSession, new GlusterVolumeGeoRepSessionParameters(masterVolumeId, remoteVolumeName, remoteHostName, remoteUserName, remoteUserGroup, !createModel.getShowEligibleVolumes().getEntity()), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { createModel.stopProgress(); if (result.getReturnValue().getSucceeded()) { if (createModel.getStartSession().getEntity()) { Frontend.getInstance().runAction(VdcActionType.StartGlusterVolumeGeoRep, new GlusterVolumeGeoRepSessionParameters(masterVolumeId, remoteVolumeName, remoteHostName), new IFrontendActionAsyncCallback() { @Override public void executed(FrontendActionAsyncResult result) { closeWindow(); if (!result.getReturnValue().getSucceeded()) { initializeGeoRepActionConfirmation(constants.geoReplicationStartTitle(), HelpTag.volume_geo_rep_start_confirmation, "volume_geo_rep_start_confirmation", constants.geoRepForceHelp(), messages.geoRepForceTitle(constants.startGeoRep()), "onStartGeoRepSession"); final GlusterVolumeGeoRepActionConfirmationModel cModel = (GlusterVolumeGeoRepActionConfirmationModel) getWindow(); cModel.setMessage(result.getReturnValue().getFault().getMessage()); } } }, VolumeGeoRepListModel.this, false); } } else { createModel.setQueryFailureMessage(result.getReturnValue().getFault().getMessage()); } } }, this, false); }