BDO
- type we are creatingpublic final class CreateAction<BDO extends DataObject> extends FormAction
FormAction
class to create the target DataObject
from a form
This class needs access to package level methods from DataObjectFactory
.Constructor and Description |
---|
CreateAction(java.lang.String type_name,
CreateTemplate<BDO> dataObjectFactory) |
CreateAction(java.lang.String type_name,
java.lang.Object text,
CreateTemplate<BDO> dataObjectFactory) |
Modifier and Type | Method and Description |
---|---|
FormResult |
action(Form f)
Perform the actual action based on the form parameters.
|
java.lang.String |
getConfirm(Form f)
should this action be confirmed before execute
If this returns null no confirm is required.
|
java.lang.Object |
getText()
Get optional button content to use instead of the action name.
|
void |
postCreate(BDO dat,
Form f) |
void |
preCommit(BDO dat,
Form f) |
getConfirmMessage, getHelp, getMustValidate, getShortcut, setConfirm, setConfirmArgs, setMustValidate, setNewWindow, wantNewWindow
public CreateAction(java.lang.String type_name, CreateTemplate<BDO> dataObjectFactory)
type_name
- User presetned name of type being created.dataObjectFactory
- public CreateAction(java.lang.String type_name, java.lang.Object text, CreateTemplate<BDO> dataObjectFactory)
public FormResult action(Form f) throws ActionException
FormAction
TransitionException
to show an error message to the user.
or a ActionException
to produce a generic error message.action
in class FormAction
f
- FormActionException
public final void preCommit(BDO dat, Form f) throws DataException, ActionException
DataException
ActionException
public void postCreate(BDO dat, Form f) throws java.lang.Exception
java.lang.Exception
public java.lang.String getConfirm(Form f)
FormAction
The form is passed to allow a sub-class to trigger confirm based on form parameters.
However in this case the implementation must handle an incomplete form.
Note that the message can be set by calling FormAction.setConfirm(String)
or
this method can be overidden
getConfirm
in class FormAction
f
- Form calling action.public java.lang.Object getText()
FormAction
UIProvider
or UIGenerator
but should not include active contentgetText
in class FormAction