T - The model for this form@JsType(namespace="hal.ui") public interface Form<T> extends org.jboss.gwt.elemento.core.IsElement, Attachable
Form items can be bound or unbound: Bound form items show the attributes of the model (text input, check boxes or select boxes). They're part of the automatic data mapping between the form and the model. Unbound form items have no relation to the model (static text or buttons). They are not part of the automatic data mapping.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Form.CancelCallback<T> |
static class |
Form.FinishRemove<T>
Callback to be used after the remove operation has been successfully executed.
|
static class |
Form.FinishReset<T>
Callback to be used after the reset operation has been successfully executed.
|
static class |
Form.Operation |
static interface |
Form.PrepareRemove<T>
Callback to prepare the remove operation.
|
static interface |
Form.PrepareReset<T>
Callback to prepare the reset operation.
|
static interface |
Form.SaveCallback<T> |
static class |
Form.State |
| Modifier and Type | Method and Description |
|---|---|
void |
addFormValidation(FormValidation<T> formValidation)
Makes it possible to validate the form as a whole or to check fields which depend on other fields.
|
void |
cancel()
Cancels any modifications to the model.
|
void |
clear()
Clears this form by removing the model reference and by clearing all form fields.
|
void |
edit(T model)
Takes the specified model and populates the editing state with the values from the model.
|
Iterable<FormItem> |
getBoundFormItems() |
<F> FormItem<F> |
getFormItem(String name) |
Iterable<FormItem> |
getFormItems() |
String |
getId() |
T |
getModel() |
StateMachine |
getStateMachine() |
boolean |
isTransient() |
boolean |
isUndefined() |
void |
remove()
Removes the model.
|
void |
reset()
Resets the model.
|
boolean |
save()
Validates the form and its fields and upon successful validation persists the changes to the model and
calls the save callback.
|
void |
setCancelCallback(Form.CancelCallback<T> cancelCallback) |
void |
setPrepareRemove(Form.PrepareRemove<T> removeCallback) |
void |
setPrepareReset(Form.PrepareReset<T> prepareReset) |
void |
setSaveCallback(Form.SaveCallback<T> saveCallback) |
void |
view(T model)
Takes the specified model and updates the read-only state with the values from the model.
|
attach, detach@JsProperty boolean isUndefined()
@JsProperty boolean isTransient()
void view(T model)
model - the model to view.void clear()
void edit(T model)
model - the model to edit.boolean save()
@JsIgnore void setSaveCallback(Form.SaveCallback<T> saveCallback)
void cancel()
@JsIgnore void setCancelCallback(Form.CancelCallback<T> cancelCallback)
@JsIgnore void setPrepareReset(Form.PrepareReset<T> prepareReset)
@JsIgnore void reset()
@JsIgnore void setPrepareRemove(Form.PrepareRemove<T> removeCallback)
@JsIgnore void remove()
@JsIgnore String getId()
@JsProperty T getModel()
@JsIgnore StateMachine getStateMachine()
@JsIgnore Iterable<FormItem> getBoundFormItems()
@JsIgnore void addFormValidation(FormValidation<T> formValidation)
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.