public class ComboField<T extends Ujo> extends Field
behaviors, CSS_REQUIRED, cssClass, DEFAULT_DELAY, feedback, key, PROPERTY_PREFIX, validator| Constructor and Description |
|---|
ComboField(Key property,
List<T> items,
Key<T,?> selectId,
Key<T,?> display) |
ComboField(String componentId,
Key<?,T> property,
List<T> items,
Key<T,?> selectId,
Key<T,?> display,
String cssClass) |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.wicket.markup.html.form.FormComponent |
createInput(String componentId,
org.apache.wicket.model.IModel 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
|
Key<T,?> |
getKeyDisplay()
Get a key to display
|
Key<T,?> |
getKeyId()
Get the indentifier key
|
static <T extends OrmUjo> |
of(Key<?,?> property,
Query<T> query,
Key<T,?> display)
Create new ComboField using database request
|
static <T extends OrmUjo> |
of(Key<?,T> property,
org.ujorm.criterion.Criterion<T> items,
Key<T,?> display)
Create new ComboField using database request
|
addBehaviour, addMaxLength, createChangeBehaviour, createLabel, createLabelModel, getCssClass, getInput, getKey, getModelValue, getResourceLabelKey, getValidator, isRequired, onChange, onInitialize, setFeedbackMessage, setModelValue, setValidator, setValidatorgetWebPage, getWebRequest, getWebResponse, getWebSessionadd, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildrenadd, addStateChange, afterRender, beforeRender, canCallListenerInterface, clearOriginalDestination, configure, continueToOriginalDestination, 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, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onDetach, onEvent, onModelChanged, onModelChanging, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, 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, wrapprotected org.apache.wicket.markup.html.form.FormComponent createInput(String componentId, org.apache.wicket.model.IModel model)
createInput in class Fieldprotected 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 static <T extends OrmUjo> ComboField<T> of(Key<?,T> property, org.ujorm.criterion.Criterion<T> items, Key<T,?> display)
public static <T extends OrmUjo> ComboField<T> of(Key<?,?> property, Query<T> query, Key<T,?> display)
Copyright © 2013. All Rights Reserved.