Class ReturnCancellationController
- java.lang.Object
-
- org.zkoss.zk.ui.event.GenericEventListener
-
- org.zkoss.zk.ui.util.GenericComposer<T>
-
- org.zkoss.zk.ui.util.GenericAutowireComposer<T>
-
- org.zkoss.zk.ui.util.GenericForwardComposer<org.zkoss.zk.ui.Component>
-
- com.hybris.cockpitng.util.ViewAnnotationAwareComposer
-
- com.hybris.cockpitng.util.DefaultWidgetController
-
- de.hybris.platform.omsbackoffice.widgets.returns.cancelreturnpopup.ReturnCancellationController
-
- All Implemented Interfaces:
com.hybris.cockpitng.core.WidgetController,com.hybris.cockpitng.dnd.WidgetDragAndDropAware,com.hybris.cockpitng.engine.WidgetInstanceManagerAware,java.io.Serializable,org.zkoss.zk.ui.event.EventListener,org.zkoss.zk.ui.event.SerializableEventListener,org.zkoss.zk.ui.util.ComponentActivationListener,org.zkoss.zk.ui.util.ComponentCloneListener,org.zkoss.zk.ui.util.Composer<org.zkoss.zk.ui.Component>,org.zkoss.zk.ui.util.ComposerExt<org.zkoss.zk.ui.Component>
public class ReturnCancellationController extends com.hybris.cockpitng.util.DefaultWidgetControllerController for the cancellation return pop up- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.ObjectCOMPLETEDprotected static java.lang.StringIN_SOCKETprotected static java.lang.StringOUT_CONFIRM
-
Constructor Summary
Constructors Constructor Description ReturnCancellationController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfirmCancelReturn()Confirm the return approval requestprotected com.hybris.cockpitng.core.events.CockpitEventQueuegetCockpitEventQueue()protected BackofficeLocaleServicegetCockpitLocaleService()org.zkoss.zul.TextboxgetCustomerName()protected EnumerationServicegetEnumerationService()protected com.hybris.cockpitng.util.notifications.NotificationServicegetNotificationService()protected ReturnCallbackServicegetReturnCallbackService()protected ReturnRequestModelgetReturnRequest()org.zkoss.zul.TextboxgetReturnRequestCode()protected java.util.Optional<CancelReason>getSelectedCancelReason(org.zkoss.zk.ui.event.Event event)Gets the label for the selected cancel reason in case the event has a target of Comboboxprotected voidhandleGlobalCancelReason(org.zkoss.zk.ui.event.Event event)Applies a global reason to all individual entries after an event is triggeredvoidinitCancelReturnForm(ReturnRequestModel inputObject)Initialize the popup to choose cancellation reasonprotected java.util.Optional<CancelReason>matchingComboboxCancelReason(java.lang.String cancelReasonLabel)Retrieve theCancelReasonaccording to the selected label in the comboboxprotected voidprocessCancellation(org.zkoss.zk.ui.event.Event event)Process the cancellation only if the user confirmed itvoidsetReturnRequest(ReturnRequestModel returnRequest)voidundoCancelReturn()Reinitialize the popup.protected voidvalidateRequest()Check if the data provided by the form are compliant with the validation rules-
Methods inherited from class com.hybris.cockpitng.util.DefaultWidgetController
doAfterCompose, doBeforeCompose, doBeforeComposeChildren, executeOperation, getDragAndDropStrategy, getLabel, getLabel, getModel, getValue, getWidgetDragAndDropStrategyRepository, getWidgetInstanceManager, getWidgetRoot, getWidgetSettings, getWidgetslot, getWidgetTitle, getWidgetUtils, initDragAndDropAwareness, initialize, initWidgetSetting, initWidgetSetting, initWidgetSetting, initWidgetSetting, initWidgetSetting, invokeListenerMethod, onSocketInput, preInitialize, sendOutput, sendOutputAfterOperation, sendOutputAfterOperation, sendOutputAfterOperation, setValue, setWidgetInstanceManager, setWidgetTitle
-
Methods inherited from class com.hybris.cockpitng.util.ViewAnnotationAwareComposer
scanEventListeners
-
Methods inherited from class org.zkoss.zk.ui.util.GenericAutowireComposer
alert, didActivate, getPage, willClone, willPassivate
-
-
-
-
Field Detail
-
IN_SOCKET
protected static final java.lang.String IN_SOCKET
- See Also:
- Constant Field Values
-
OUT_CONFIRM
protected static final java.lang.String OUT_CONFIRM
- See Also:
- Constant Field Values
-
COMPLETED
protected static final java.lang.Object COMPLETED
-
-
Method Detail
-
initCancelReturnForm
public void initCancelReturnForm(ReturnRequestModel inputObject)
Initialize the popup to choose cancellation reason- Parameters:
inputObject- the return request for which we want set the cancellation reason
-
handleGlobalCancelReason
protected void handleGlobalCancelReason(org.zkoss.zk.ui.event.Event event)
Applies a global reason to all individual entries after an event is triggered- Parameters:
event- the on select event that was triggered by the user
-
matchingComboboxCancelReason
protected java.util.Optional<CancelReason> matchingComboboxCancelReason(java.lang.String cancelReasonLabel)
Retrieve theCancelReasonaccording to the selected label in the combobox- Parameters:
cancelReasonLabel- aStringrepresentation of the reason- Returns:
- the CancelReason corresponding to the label
-
getSelectedCancelReason
protected java.util.Optional<CancelReason> getSelectedCancelReason(org.zkoss.zk.ui.event.Event event)
Gets the label for the selected cancel reason in case the event has a target of Combobox- Parameters:
event- the event that was fired- Returns:
- the CancelReason corresponding to the label.
-
undoCancelReturn
public void undoCancelReturn()
Reinitialize the popup.
-
confirmCancelReturn
public void confirmCancelReturn()
Confirm the return approval request
-
processCancellation
protected void processCancellation(org.zkoss.zk.ui.event.Event event)
Process the cancellation only if the user confirmed it- Parameters:
event- the confirmation event coming from the user
-
validateRequest
protected void validateRequest()
Check if the data provided by the form are compliant with the validation rules
-
getReturnRequest
protected ReturnRequestModel getReturnRequest()
-
setReturnRequest
public void setReturnRequest(ReturnRequestModel returnRequest)
-
getEnumerationService
protected EnumerationService getEnumerationService()
-
getCockpitLocaleService
protected BackofficeLocaleService getCockpitLocaleService()
-
getCockpitEventQueue
protected com.hybris.cockpitng.core.events.CockpitEventQueue getCockpitEventQueue()
-
getReturnCallbackService
protected ReturnCallbackService getReturnCallbackService()
-
getNotificationService
protected com.hybris.cockpitng.util.notifications.NotificationService getNotificationService()
-
getCustomerName
public org.zkoss.zul.Textbox getCustomerName()
-
getReturnRequestCode
public org.zkoss.zul.Textbox getReturnRequestCode()
-
-