public abstract class DynamicInputForm
extends org.apache.wicket.markup.html.form.StatelessForm
Form
for Panel
s / WebMarkupContainer
s to allow configurable generic Search / Input parameters
FacetMeta
to Object value; where Object represents the Model of the Added ComponentsdefineParams(List)
Constructor and Description |
---|
DynamicInputForm(String formComponentId,
List<FacetMeta> facetMetas,
org.apache.wicket.markup.html.WebMarkupContainer container,
List<ChangeListener<Object>> listeners,
List<org.apache.wicket.Component> targetsToUpdateViaAjax)
Create a Form with dynamic search params
The listeners to #getSearchParamsForm(List, WebMarkupContainer, List) can expect an event of:
If #eventFormatArray true, On Ajax Submit - Object[] {Object}; where Object in the Array represents all the Model Objects of the Added Components; Inputs
If #eventFormatArray false, On Ajax Submit - Map {FacetMeta as Key, Object value}
|
Modifier and Type | Method and Description |
---|---|
protected org.apache.wicket.markup.html.form.Button |
addSubmitButton(List<FacetMeta> facetMetas,
List<org.apache.wicket.Component> rawAddedComponents,
List<ChangeListener<Object>> listeners,
List<org.apache.wicket.Component> targetsToUpdateViaAjax)
Some forms may want to include Dynamic params as part of a Bigger Form and hence the Submit button and related processing can be overridden.
|
protected Object |
defineParams(List<org.apache.wicket.Component> rawAddedComponents)
Define what Data-Structure will be used to maintain the Form values; so they can be returned as an Event to the listeners
|
protected abstract EntityDetailsTemplatePanel |
getInputTemplatePanel(String id,
org.apache.wicket.model.IModel model,
EntityTemplate template,
CustomTemplateRenderAdapter defaultRenderAdapter)
Define the Template panel responsible for rendering the Input params
|
void |
onSubmit(org.apache.wicket.ajax.AjaxRequestTarget target,
org.apache.wicket.markup.html.form.Form<?> form,
List<FacetMeta> facetMetas,
List<org.apache.wicket.Component> rawAddedComponents,
List<ChangeListener<Object>> listeners,
List<org.apache.wicket.Component> targetsToUpdateViaAjax) |
protected Object |
transformValue(FacetMeta facetMeta,
Object value)
An opportunity to modify or transform the raw input value before its passed as a result in the params/event
|
protected void |
updateParamsWithValue(Object params,
int index,
FacetMeta facetMeta,
Object value) |
getStatelessHint, process
add, appendDefaultButtonField, beforeUpdateFormComponentModels, clearInput, delegateSubmit, encodeUrlInHiddenFields, error, findForm, findSubmittingButton, getDefaultButton, getFormValidators, getHiddenFieldId, getInputNamePrefix, getJavascriptId, getJsForInterfaceUrl, getMaxSize, getMethod, getModel, getModelObject, getRootForm, getRootFormRelativeId, getValidatorKeyPrefix, getValuePersister, handleMultiPart, hasError, internalOnModelChanged, isRootForm, isSubmitted, isVersioned, loadPersistentFormComponentValues, markFormComponentsInvalid, markFormComponentsValid, onBeforeRender, onComponentTag, onComponentTagBody, onDetach, onError, onFileUploadException, onFormSubmitted, onSubmit, onValidate, process, registerJavascriptNamespaces, remove, removePersistentFormComponentValues, renderHead, renderPlaceholderTag, setDefaultButton, setMaxSize, setModel, setModelObject, setMultiPart, setVersioned, updateFormComponentModels, validate, validateComponents, validateFormValidator, validateFormValidators, visitFormComponents, visitFormComponentsPostOrder, writeParamsAsHiddenFields
getMarkupType, getWebPage, getWebRequest
add, addOrReplace, autoAdd, autoAdd, contains, findMarkupStream, get, get, getAssociatedMarkupStream, getMarkupStream, hasAssociatedMarkup, internalAdd, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, renderNext, replace, setDefaultModel, setMarkupStream, size, swap, toString, toString, visitChildren, visitChildren
add, addStateChange, afterRender, beforeRender, callOnBeforeRenderIfNotVisible, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, configure, continueToOriginalDestination, debug, detach, detachBehaviors, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getBehaviors, getBehaviors, getBehaviorsRawList, getClassRelativePath, getComponentBorder, getConverter, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdImpl, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResponse, getSession, getSizeInBytes, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalAttach, internalDetach, internalOnAttach, internalOnDetach, isActionAuthorized, isAncestorOf, isAttached, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVisibilityAllowed, isVisible, isVisibleInHierarchy, locateMarkupStream, markAttached, markRendering, modelChanged, modelChanging, onAfterRender, onAttach, onBeginRequest, onConfigure, onEndRequest, onInitialize, onModelChanged, onModelChanging, onRemove, prepareForRender, prepareForRender, redirectToInterceptPage, remove, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, renderHead, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, setAuto, setComponentBorder, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVisibilityAllowed, setVisible, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn, wrap
public DynamicInputForm(String formComponentId, List<FacetMeta> facetMetas, org.apache.wicket.markup.html.WebMarkupContainer container, List<ChangeListener<Object>> listeners, List<org.apache.wicket.Component> targetsToUpdateViaAjax)
#getSearchParamsForm(List, WebMarkupContainer, List)
can expect an event of:
#eventFormatArray
true, On Ajax Submit - Object[] {Object}; where Object in the Array represents all the Model Objects of the Added Components; Inputs#eventFormatArray
false, On Ajax Submit - Map {FacetMeta as Key, Object value}facetMetas
- as List
of configurable FacetMeta
that define the custom Input fieldsinputParamsTemplatePanel
- as EntityDetailsTemplatePanel
type panel, that will be responsible to render the input elementslisteners
- as Submit Action listeners to an INPUT action these may also be Components that can be updated via Ajax targettargetsToUpdateViaAjax
- asWicket Component
s that are updated via Ajax target (For Components that cannot implement ChangeListener
protected org.apache.wicket.markup.html.form.Button addSubmitButton(List<FacetMeta> facetMetas, List<org.apache.wicket.Component> rawAddedComponents, List<ChangeListener<Object>> listeners, List<org.apache.wicket.Component> targetsToUpdateViaAjax)
facetMetas
- as List
of FacetMeta
rawAddedComponents
- as List of Component
slisteners
- as List
of ChangeListener
stargetsToUpdateViaAjax
- as List
of Componentspublic void onSubmit(org.apache.wicket.ajax.AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form, List<FacetMeta> facetMetas, List<org.apache.wicket.Component> rawAddedComponents, List<ChangeListener<Object>> listeners, List<org.apache.wicket.Component> targetsToUpdateViaAjax)
protected Object transformValue(FacetMeta facetMeta, Object value)
fm
- as FacetMeta
value
- protected abstract EntityDetailsTemplatePanel getInputTemplatePanel(String id, org.apache.wicket.model.IModel model, EntityTemplate template, CustomTemplateRenderAdapter defaultRenderAdapter)
id
- as Component Idmodel
- as IModeltemplate
- as EntityTemplate
defaultRenderAdapter
- as CustomTemplateRenderAdapter
EntityDetailsTemplatePanel
type panel, that will be responsible to render the input elementsprotected Object defineParams(List<org.apache.wicket.Component> rawAddedComponents)
rawAddedComponents
- as List
of Component
sprotected void updateParamsWithValue(Object params, int index, FacetMeta facetMeta, Object value)
params
- as the Datastructure defined by defineParams(List)
index
- as int ; index of the Component in the list (same sequence as input FacetMeta
)facetMeta
- as FacetMeta
for this item.value
- as the Value inputCopyright © 2018. All rights reserved.