public class ComboField<T extends org.ujorm.Ujo> extends Field<T>
behaviors, CSS_REQUIRED, cssClass, DEFAULT_DELAY, feedback, key, PROPERTY_PREFIX, validatorsENABLE, FLAG_AFTER_RENDERING, FLAG_INITIALIZED, FLAG_PREPARED_FOR_RENDER, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RENDERING, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING| Constructor and Description |
|---|
ComboField(org.ujorm.Key<U,T> key,
List<T> items,
org.ujorm.Key<T,?> selectId,
org.ujorm.Key<T,?> display) |
ComboField(String componentId,
org.ujorm.Key<U,T> key,
List<T> items,
org.ujorm.Key<T,?> selectId,
org.ujorm.Key<T,?> display,
String cssClass) |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.wicket.ajax.AjaxEventBehavior |
createChangeBehaviour(String action,
String jsEvent)
Create new AjaxFormComponentUpdatingBehavior with delay 300 ms.
|
protected org.apache.wicket.markup.html.form.FormComponent |
createInput(String componentId,
org.apache.wicket.model.IModel<T> model)
Create Form inputComponent
|
protected Object |
getComboDisplayValue(T object)
Get the value for displaying to an end user.
|
protected String |
getComboIdValue(T object,
int index)
This method is called to get the id value of an object (used as the value attribute of a
choice element) The id can be extracted from the object like a primary key,
or if the list is stable you could just return a toString of the index.
|
List<T> |
getItems()
Get component items
|
org.ujorm.Key<T,?> |
getKeyDisplay()
Get a key to display
|
org.ujorm.Key<T,?> |
getKeyId()
Get the identifier key
|
static <T extends OrmUjo> |
of(org.ujorm.Key<?,T> key,
org.ujorm.criterion.Criterion<T> items,
org.ujorm.Key<T,?> display)
Create new ComboField using database request
|
static <T extends OrmUjo> |
of(org.ujorm.Key<?,T> key,
Query<T> query,
org.ujorm.Key<T,?> display)
Create new ComboField using database request
|
void |
onChange(String action)
Create an Updating Behavior with "keyup" event
|
addBehaviour, addBehaviourOnBlur, addCssStyle, addCssStyle, addMaxLength, addValidator, addValidator, clearFeedbackMessages, createLabel, createLabelModel, getCssClass, getInput, getKey, getKeyName, getKeyName, getModelValue, getResourceLabelKey, getValidators, getVisibleModel, isEnabled, isRequired, onConfigure, onInitialize, onSuperInitialize, requestFocus, setEnabledInput, setFeedbackMessage, setModelValue, setVisibleModel, toStringgetModel, getModelObject, setModel, setModelObjectgetRegionMarkup, newMarkupSourcingStrategygetWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSessionadd, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findComponentToDequeue, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onAfterRenderChildren, onComponentTagBody, onDetach, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, visitChildren, visitChildren, visitChildren, visitChildrenadd, addStateChange, afterRender, beforeRender, canCallListenerInterface, canCallListenerInterfaceAfterExpiry, clearOriginalDestination, configure, continueToOriginalDestination, createConverter, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, info, initModel, internalOnModelChanged, internalPrepareForRender, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onComponentTag, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, visitParents, warn, wrapclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic ComboField(org.ujorm.Key<U,T> key, List<T> items, org.ujorm.Key<T,?> selectId, org.ujorm.Key<T,?> display)
protected org.apache.wicket.markup.html.form.FormComponent createInput(String componentId, org.apache.wicket.model.IModel<T> model)
createInput in class Field<T extends org.ujorm.Ujo>protected Object getComboDisplayValue(T object)
object - the actual objectprotected String getComboIdValue(T object, int index)
Note that the given index can be -1 if the object in question is not contained in the
available choices.
object - The object for which the id should be generatedindex - The index of the object in the choices list.public final org.ujorm.Key<T,?> getKeyId()
public final org.ujorm.Key<T,?> getKeyDisplay()
public void onChange(String action)
protected org.apache.wicket.ajax.AjaxEventBehavior createChangeBehaviour(String action, String jsEvent)
createChangeBehaviour in class Field<T extends org.ujorm.Ujo>public static <T extends OrmUjo> ComboField<T> of(org.ujorm.Key<?,T> key, org.ujorm.criterion.Criterion<T> items, org.ujorm.Key<T,?> display)
public static <T extends OrmUjo> ComboField<T> of(org.ujorm.Key<?,T> key, Query<T> query, org.ujorm.Key<T,?> display)
Copyright © 2021. All rights reserved.