Package com.storedobject.ui
Class SteppedDataForm
java.lang.Object
com.storedobject.vaadin.View
com.storedobject.ui.SteppedView
com.storedobject.ui.SteppedDataForm
- All Implemented Interfaces:
Executable,Reentrant,HasLogic,Transactional,ClickHandler,ExecutableView,ValueChangeHandler,com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.ClickEvent<? extends com.vaadin.flow.component.Component>>,com.vaadin.flow.component.HasValue.ValueChangeListener,Serializable,Runnable,EventListener
A Data Form for editing one or more objects that has multiple steps of content views.
All content views may not have to be using the same object.
- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.storedobject.vaadin.ClickHandler
ClickHandler.ModifiedClickEvent<C extends com.vaadin.flow.component.Component> -
Constructor Summary
ConstructorsConstructorDescriptionSteppedDataForm(int numberOfSteps) Constructor.SteppedDataForm(int numberOfSteps, String caption) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected final booleancommit(int step) This method is invoked before invokingSteppedView.complete(int)and if it raises any error or returnsfalse, forward movement will be stopped.protected ObjectForm<?> createObjectForm(int step) Create the form for the step.protected voidenter(int step) This method is invoked when you enter into this step.protected voidOverride this if you want to do something before the View comes up on the screen.protected StringListgetFields(int step) Get field names for the step.protected IncludeFieldgetIncludeFieldChecker(int step) Return the "include field checker" for the step.protected ObjectgetObject(int step) Get the object value from a given step.protected Class<?> getObjectClass(int step) IfcreateObjectForm(int)returnsnull, the class returned by this method is used to create the form for the step.protected final ObjectForm<?> getObjectForm(int step) Get the form for the step.protected final com.vaadin.flow.component.ComponentgetStepComponent(int step) Get the component to be used for the respective step.protected voidSet the object to the given steps.Methods inherited from class com.storedobject.ui.SteppedView
addExtraButton, align, back, cancel, center, complete, complete, finish, formsConstructed, getStepCaption, getStepLabel, goToStep, hideBackButton, hideCancelButton, hideFinishButton, hideNextButton, initUI, isFinalStep, isFirstStep, justify, nextStep, previousStep, setBackLabel, setCancelLabel, setFinishLabel, setNextLabel, unhideBackButton, unhideCancelButton, unhideFinishButton, unhideNextButtonMethods inherited from class com.storedobject.vaadin.View
abort, aborted, addClosedListener, addOpenedListener, clean, close, createCloseableView, createWindow, decorateComponent, execute, execute, executing, focus, focus, focusAny, getApplication, getCaption, getComponent, getContent, getCreatedBy, getEmbeddedView, getMenuItem, getMenuItem, getView, invoke, isFullScreen, isScrollable, isWindowMode, select, setCaption, setComponent, setCreatedBy, setDefaultPadding, setEmbeddedView, setFirstFocus, setFullScreen, setScrollable, setWindowMode, skipFirstFocusMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.storedobject.vaadin.ClickHandler
clicked, doubleClicked, onComponentEvent, rightClickedMethods inherited from interface com.storedobject.common.Executable
actMethods inherited from interface com.storedobject.vaadin.ExecutableView
abort, clean, clearAlerts, clicked, close, createMenuItem, error, execute, getApplication, getCaption, getMenuIconName, getMenuItem, getView, getView, invoke, isCloseable, isFullScreen, isHomeView, log, log, message, returnedFrom, run, setCaption, setClickable, speak, trackValueChange, tray, valueChanged, warningMethods inherited from interface com.storedobject.common.Reentrant
isReentrantMethods inherited from interface com.storedobject.ui.Transactional
commit, execute, getLogic, getTransactionManager, run, setLogic, transact, transact, transactControl, transactControl, transactControl, transactControlMethods inherited from interface com.storedobject.vaadin.ValueChangeHandler
valueChanged
-
Constructor Details
-
SteppedDataForm
public SteppedDataForm(int numberOfSteps) Constructor.- Parameters:
numberOfSteps- Number of steps
-
SteppedDataForm
Constructor.- Parameters:
numberOfSteps- Number of stepscaption- Caption for the view
-
-
Method Details
-
execute
Description copied from class:ViewOverride this if you want to do something before the View comes up on the screen. Call super.execute(parent, doNotLock) to make the View appear on the screen. Parent view is automatically selected when this view closes. -
commit
protected final boolean commit(int step) Description copied from class:SteppedViewThis method is invoked before invokingSteppedView.complete(int)and if it raises any error or returnsfalse, forward movement will be stopped.- Overrides:
commitin classSteppedView- Parameters:
step- Step- Returns:
- True if the commit operation is successful.
-
getStepComponent
protected final com.vaadin.flow.component.Component getStepComponent(int step) Description copied from class:SteppedViewGet the component to be used for the respective step. (After creating your component, you may invoke one of these static methods to position the component if needed:SteppedView.align(Component, CSSGrid.Position),SteppedView.justify(Component, CSSGrid.Position),SteppedView.center(Component)).- Overrides:
getStepComponentin classSteppedView- Parameters:
step- Step- Returns:
- Component to be added. (Default implementation) returns
null.
-
getObjectForm
Get the form for the step.- Parameters:
step- Step- Returns:
- Form for the step.
-
createObjectForm
Create the form for the step.- Parameters:
step- Step- Returns:
- Form for the step. If returned
nulla default form will be created for the class returned bygetObjectClass(int). Default implementation returnsnull. So, either this method orgetObjectClass(int)should return anon-nullvalue.
-
getObjectClass
IfcreateObjectForm(int)returnsnull, the class returned by this method is used to create the form for the step.- Parameters:
step- Step- Returns:
- Default implementation returns
null. So, either this method orcreateObjectForm(int)should return anon-nullvalue.
-
getIncludeFieldChecker
Return the "include field checker" for the step. If this method returns anon-nullvalue, that will be used to filter out field names of the object in this step, otherwise,getFields(int)will be used to identify the fields.- Parameters:
step- Step- Returns:
- Default implementation returns
null.
-
getFields
Get field names for the step. This will be invoked only ifgetIncludeFieldChecker(int)returnsnull.- Parameters:
step- Step- Returns:
- Default implementation returns
null.
-
setObject
Set the object to the given steps.- Parameters:
object- Object to setsteps- Steps
-
getObject
Get the object value from a given step.- Parameters:
step- Step- Returns:
- Object value
-
enter
protected void enter(int step) Description copied from class:SteppedViewThis method is invoked when you enter into this step.- Overrides:
enterin classSteppedView- Parameters:
step- Step
-