|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.Component
org.apache.wicket.MarkupContainer
org.apache.wicket.markup.html.WebMarkupContainer
org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup
org.apache.wicket.markup.html.panel.Panel
org.apache.wicket.extensions.markup.html.form.palette.Palette
public class Palette
Palette is a component that allows the user to easily select and order multiple items by moving them from one select box into another.
When creating a Palette object make sure your IChoiceRenderer returns a specific ID, not the index.
Ajaxifying the palette: The palette itself cannot be ajaxified because it is a
panel and therefore does not receive any javascript events. Instead ajax behaviors can be
attached to the recorder component which supports the javascript onchange event.
The recorder component can be retrieved via a call to getRecorderComponent().
Example:
Form form=new Form(...);
Palette palette=new Palette(...);
palette.getRecorderComponent().add(new AjaxFormComponentUpdatingBehavior("onchange") {...});
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.wicket.Component |
|---|
org.apache.wicket.Component.ComponentModelChange, org.apache.wicket.Component.EnabledChange, org.apache.wicket.Component.IVisitor, org.apache.wicket.Component.VisibilityChange |
| Field Summary |
|---|
| Fields inherited from class org.apache.wicket.Component |
|---|
ENABLE, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER |
| Constructor Summary | |
|---|---|
Palette(java.lang.String id,
org.apache.wicket.model.IModel choicesModel,
org.apache.wicket.markup.html.form.IChoiceRenderer choiceRenderer,
int rows,
boolean allowOrder)
|
|
Palette(java.lang.String id,
org.apache.wicket.model.IModel model,
org.apache.wicket.model.IModel choicesModel,
org.apache.wicket.markup.html.form.IChoiceRenderer choiceRenderer,
int rows,
boolean allowOrder)
|
|
| Method Summary | |
|---|---|
protected java.lang.String |
buildJSCall(java.lang.String funcName)
builds javascript handler call |
protected java.util.Map |
getAdditionalAttributesForChoices(java.lang.Object choice)
|
protected java.util.Map |
getAdditionalAttributesForSelection(java.lang.Object choice)
|
java.lang.String |
getAddOnClickJS()
|
org.apache.wicket.markup.html.form.IChoiceRenderer |
getChoiceRenderer()
|
java.util.Collection |
getChoices()
|
java.lang.String |
getChoicesOnFocusJS()
|
protected org.apache.wicket.ResourceReference |
getCSS()
Returns the resource reference of the default stylesheet. |
java.lang.String |
getDownOnClickJS()
|
java.util.Collection |
getModelCollection()
|
Recorder |
getRecorderComponent()
Returns recorder component. |
java.lang.String |
getRemoveOnClickJS()
|
int |
getRows()
|
java.util.Iterator |
getSelectedChoices()
|
java.lang.String |
getSelectionOnFocusJS()
|
protected org.apache.wicket.markup.html.resources.StyleSheetReference |
getStyleSheet()
Can be overriden by clients for custom style sheet |
java.util.Iterator |
getUnselectedChoices()
|
java.lang.String |
getUpOnClickJS()
|
boolean |
isPaletteEnabled()
Return true if the palette is enabled, false otherwise |
protected org.apache.wicket.Component |
newAddComponent()
factory method for the addcomponent |
protected org.apache.wicket.Component |
newAvailableHeader(java.lang.String componentId)
factory method for the available items header |
protected org.apache.wicket.Component |
newChoicesComponent()
factory method for the available items component |
protected org.apache.wicket.Component |
newDownComponent()
factory method for the move down component |
protected org.apache.wicket.Component |
newRemoveComponent()
factory method for the remove component |
protected org.apache.wicket.Component |
newSelectedHeader(java.lang.String componentId)
factory method for the selected items header |
protected org.apache.wicket.Component |
newSelectionComponent()
factory method for the selected items component |
protected org.apache.wicket.Component |
newUpComponent()
factory method for the move up component |
protected void |
onBeforeRender()
|
protected void |
onDetach()
|
void |
renderHead(org.apache.wicket.markup.html.IHeaderResponse response)
Renders header contributions |
protected void |
updateModel()
The model object is assumed to be a Collection, and it is modified in-place. |
| Methods inherited from class org.apache.wicket.markup.html.panel.Panel |
|---|
onComponentTag, onComponentTagBody, renderHead |
| Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainerWithAssociatedMarkup |
|---|
newHeaderPartContainer, renderHeadFromAssociatedMarkupFile |
| Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer |
|---|
getMarkupType, getWebPage |
| Methods inherited from class org.apache.wicket.MarkupContainer |
|---|
add, addOrReplace, autoAdd, autoAdd, contains, findMarkupStream, get, getAssociatedMarkupStream, getMarkupStream, hasAssociatedMarkup, internalAdd, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, setModel, size, toString, toString, visitChildren, visitChildren |
| Methods inherited from class org.apache.wicket.Component |
|---|
add, addStateChange, afterRender, beforeRender, callOnBeforeRenderIfNotVisible, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, continueToOriginalDestination, debug, detach, detachBehaviors, detachModel, detachModels, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getBehaviors, getBehaviors, getClassRelativePath, getComponentBorder, getConverter, getConverter, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMetaData, getModel, getModelComparator, getModelObject, getModelObjectAsString, getModelObjectAsString, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageFactory, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalAttach, internalDetach, internalOnAttach, internalOnDetach, internalOnModelChanged, isActionAuthorized, isAncestorOf, isAttached, isBehaviorAccepted, isEnableAllowed, isEnabled, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisible, isVisibleInHierarchy, locateMarkupStream, markAttached, markRendering, modelChanged, modelChanging, newPage, newPage, onAfterRender, onAttach, onBeginRequest, onEndRequest, onModelChanged, onModelChanging, prepareForRender, redirectToInterceptPage, remove, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, setAuto, setComponentBorder, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMarkupId, setMetaData, setModelObject, setOutputMarkupId, setOutputMarkupPlaceholderTag, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisible, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn, wrap |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Palette(java.lang.String id,
org.apache.wicket.model.IModel choicesModel,
org.apache.wicket.markup.html.form.IChoiceRenderer choiceRenderer,
int rows,
boolean allowOrder)
id - Component idchoicesModel - Model representing collection of all available choiceschoiceRenderer - Render used to render choices. This must use unique IDs for the objects, not the
index.rows - Number of choices to be visible on the screen with out scrollingallowOrder - Allow user to move selections up and down
public Palette(java.lang.String id,
org.apache.wicket.model.IModel model,
org.apache.wicket.model.IModel choicesModel,
org.apache.wicket.markup.html.form.IChoiceRenderer choiceRenderer,
int rows,
boolean allowOrder)
id - Component idmodel - Model representing collection of user's selectionschoicesModel - Model representing collection of all available choiceschoiceRenderer - Render used to render choices. This must use unique IDs for the objects, not the
index.rows - Number of choices to be visible on the screen with out scrollingallowOrder - Allow user to move selections up and down| Method Detail |
|---|
protected void onBeforeRender()
onBeforeRender in class org.apache.wicket.Componentprotected org.apache.wicket.ResourceReference getCSS()
protected org.apache.wicket.markup.html.resources.StyleSheetReference getStyleSheet()
public final boolean isPaletteEnabled()
public java.util.Iterator getSelectedChoices()
public java.util.Iterator getUnselectedChoices()
protected org.apache.wicket.Component newAvailableHeader(java.lang.String componentId)
componentId - component id of the returned header component
protected org.apache.wicket.Component newSelectedHeader(java.lang.String componentId)
componentId - component id of the returned header component
protected org.apache.wicket.Component newDownComponent()
protected org.apache.wicket.Component newUpComponent()
protected org.apache.wicket.Component newRemoveComponent()
protected org.apache.wicket.Component newAddComponent()
protected org.apache.wicket.Component newSelectionComponent()
protected java.util.Map getAdditionalAttributesForSelection(java.lang.Object choice)
org.apache.wicket.extensions.markup.html.form.palette.componentprotected org.apache.wicket.Component newChoicesComponent()
protected java.util.Map getAdditionalAttributesForChoices(java.lang.Object choice)
org.apache.wicket.extensions.markup.html.form.palette.componentpublic final Recorder getRecorderComponent()
onchange javascript event whenever a
change in selection occurs.
public java.util.Collection getChoices()
public java.util.Collection getModelCollection()
public org.apache.wicket.markup.html.form.IChoiceRenderer getChoiceRenderer()
public int getRows()
protected final void updateModel()
Model.setObject(Object) is called with the same instance: it allows the Model to be
notified of changes even when Model.getObject() returns a different
Collection at every invocation.
FormComponent.updateModel()protected java.lang.String buildJSCall(java.lang.String funcName)
funcName - name of javascript function to call
public java.lang.String getChoicesOnFocusJS()
public java.lang.String getSelectionOnFocusJS()
public java.lang.String getAddOnClickJS()
public java.lang.String getRemoveOnClickJS()
public java.lang.String getUpOnClickJS()
public java.lang.String getDownOnClickJS()
protected void onDetach()
onDetach in class org.apache.wicket.Componentpublic void renderHead(org.apache.wicket.markup.html.IHeaderResponse response)
renderHead in interface org.apache.wicket.markup.html.IHeaderContributorresponse -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||