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 boolean
commit
(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 void
enter
(int step) This method is invoked when you enter into this step.protected void
Override this if you want to do something before the View comes up on the screen.protected StringList
getFields
(int step) Get field names for the step.protected IncludeField
getIncludeFieldChecker
(int step) Return the "include field checker" for the step.protected Object
getObject
(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.Component
getStepComponent
(int step) Get the component to be used for the respective step.protected void
Set 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, unhideNextButton
Methods 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, skipFirstFocus
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.storedobject.vaadin.ClickHandler
clicked, doubleClicked, onComponentEvent, rightClicked
Methods inherited from interface com.storedobject.common.Executable
act
Methods 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, warning
Methods inherited from interface com.storedobject.common.Reentrant
isReentrant
Methods inherited from interface com.storedobject.ui.Transactional
commit, execute, getLogic, getTransactionManager, run, setLogic, transact, transact, transactControl, transactControl
Methods 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:View
Override 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:SteppedView
This method is invoked before invokingSteppedView.complete(int)
and if it raises any error or returnsfalse
, forward movement will be stopped.- Overrides:
commit
in 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:SteppedView
Get 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:
getStepComponent
in 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
null
a default form will be created for the class returned bygetObjectClass(int)
. Default implementation returnsnull
. So, either this method orgetObjectClass(int)
should return anon-null
value.
-
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-null
value.
-
getIncludeFieldChecker
Return the "include field checker" for the step. If this method returns anon-null
value, 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:SteppedView
This method is invoked when you enter into this step.- Overrides:
enter
in classSteppedView
- Parameters:
step
- Step
-