public final class UIFormSpec extends Object
This class if for compatibility with user services developed using older versions of EBX®. This class
must not
be used with user services implementing interface UserService
.
It is possible to set the buttons in a bottom bar.
This feature enables a special layout for the workspace: the bottom bar is fixed at the bottom, and the scrollbar on the right is drawn to fit the space between the header and the bottom bar.
All properties of this object must be set before calling
UIServiceComponentWriter.startForm(UIFormSpec)
.
Caution: Due to this special layout, no content (HTML code) is allowed before or after the form.
UIServiceComponentWriter.startForm(UIFormSpec)
Constructor and Description |
---|
UIFormSpec() |
Modifier and Type | Method and Description |
---|---|
void |
addActionBackInBottomBar(UIButtonSpec actionBack)
Adds a button on the left side of the bottom bar.
|
void |
addActionBackInBottomBar(UIButtonSpec actionBack,
boolean isPreviousStep)
Adds a button on the left side of the bottom bar.
|
void |
addActionForwardInBottomBar(UIButtonSpec actionForward)
Adds a button on the right side of the bottom bar.
|
void |
addActionForwardInBottomBar(UIButtonSpec actionForward,
boolean isNextStep)
Adds a button on the right side of the bottom bar.
|
void |
addActionInplaceInBottomBar(UIButtonSpec actionInplace)
Adds a button at the center of the bottom bar.
|
void |
setDetectionOfLostModificationDisabled(boolean isDisabled)
Sets whether or not the user is prompted for a confirmation when input
has been entered in the form, but the page is abandoned before saving the input.
|
void |
setId(String id)
Defines the HTML id for the
form element. |
void |
setJsFnNameToCallBeforeSubmit(String jsFnNameToCallBeforeSubmit)
Sets a JavaScript's function to be called before submitting the form.
|
void |
setMarginForContent(boolean hasMarginForContent)
Deprecated.
Since 5.4.0 which provides new look & feel.
UICSSClasses.CONTAINER_WITH_TEXT can still be used
to include a margin around text. |
void |
setMultipart(boolean isMultipart)
Defines whether of not the form has multiple parts.
|
void |
setURLForAction(String urlForAction)
Defines the URL of the
action attribute
of the form . |
public void addActionBackInBottomBar(UIButtonSpec actionBack)
Caution: If the form contains a bottom bar, no content (HTML code) is allowed before or after the form.
actionBack
- the button's specification.UIButtonSpecSubmit
public void addActionBackInBottomBar(UIButtonSpec actionBack, boolean isPreviousStep)
Caution: If the form contains a bottom bar, no content (HTML code) is allowed before or after the form.
actionBack
- the button's specification.isPreviousStep
- true
to defines that the button will
induce the previous screen/step,
false
otherwise.UIButtonSpecSubmit
public void addActionForwardInBottomBar(UIButtonSpec actionForward)
Caution: If the form contains a bottom bar, no content (HTML code) is allowed before or after the form.
actionForward
- the button's specification.UIButtonSpecSubmit
public void addActionForwardInBottomBar(UIButtonSpec actionForward, boolean isNextStep)
Caution: If the form contains a bottom bar, no content (HTML code) is allowed before or after the form.
actionForward
- the button's specification.isNextStep
- true
to defines that the button will
induce the next screen/step,
false
otherwise.UIButtonSpecSubmit
public void addActionInplaceInBottomBar(UIButtonSpec actionInplace)
Caution: If the form contains a bottom bar, no content (HTML code) is allowed before or after the form.
actionInplace
- the button's specification.s
public void setId(String id)
form
element.
This id is useful for finding the form
element using JavaScript.
For instance, to list a form's elements.
The id attribute must respect the W3C Recommendation (such as being unique in the page). See https://www.w3.org/TR/REC-html40/struct/global.html#adef-id for more information.
id
- the HTML id of the form
.public void setJsFnNameToCallBeforeSubmit(String jsFnNameToCallBeforeSubmit)
The DOM form element will be given as an argument of this function.
Example:
If the JavaScript's function returns true
and
the clicked submit button has a confirmation message,
the confirmation message will be displayed after calling of
the JavaScript's function.
If the form is submitted by clicking a submit button, that button
can be accessed using formEl.ebx_lastSubmitFocused
;
otherwise formEl.ebx_lastSubmitFocused
is
null
.
jsFnNameToCallBeforeSubmit
- the name of the JavaScript function to call before submitting the form.public void setMarginForContent(boolean hasMarginForContent)
UICSSClasses.CONTAINER_WITH_TEXT
can still be used
to include a margin around text.
Default value is false
.
hasMarginForContent
- true
to enable margin for content,
false
otherwise.public void setMultipart(boolean isMultipart)
Default value is false
.
isMultipart
- true
to enable multipart,
false
otherwise.public void setURLForAction(String urlForAction)
action
attribute
of the form
.
By default, the URL is null
, so the form will
submit values to the current page.
urlForAction
- the URL of the action
attribute of the form
.public void setDetectionOfLostModificationDisabled(boolean isDisabled)
Default value is false
.
isDisabled
- true
to disable form detection upon leaving the page,
false
to enable it and reset to default.UIButtonSpecNavigation.setAskBeforeLeavingModifiedForm(boolean)