|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.primix.tapestry.AbstractComponent | +--com.primix.tapestry.BaseComponent | +--net.sf.tapestry.contrib.palette.Palette
A component used to make a number of selections from a list. The general look is a pair of <select> elements. with a pair of buttons between them. The right element is a list of values that can be selected. The buttons move values from the right column ("available") to the left column ("selected").
This all takes a bit of JavaScript to accomplish (quite a bit), which means
a Body
component must wrap the Palette. If JavaScript is not enabled
in the client browser, then the user will be unable to make (or change) any selections.
Parameter | Type | Read / Write | Required | Default | Description |
selected | List |
R | yes | A list of selected values. Possible selections are defined by the model; this
should be a subset of the possible values. The Set must be writable; when
the form is submitted, the set will be cleared and filled with the
values selected by the user.
The order may be set by the user, as well, depending on the sortMode parameter. | |
model | IPropertySelectionModel |
R | yes | Works, as with a PropertySelection component, to define the
possible values.
| |
sort | SortMode | R | no | SortMode.NONE |
Controls automatic sorting of the options. |
rows | int | R | no | 10 | The number of rows that should be visible in the Pallete's <select> elements. |
tableClass | String | R | no | tapestry-palette | The CSS class for the table which surrounds the other elements of the Palette. |
selectedTitleBlock | Block |
R no | "Selected" | If specified, allows a Block to be placed within
the <th> reserved for the title above the selected items
<select> (on the right). This allows for images or other components to
be placed there. By default, the simple word Selected
is used. | |
availableTitleBlock | Block |
R no | "Available" | As with selectedTitleBlock, but for the left column, of items
which are available to be selected. The default is the word
Available . | |
selectImage
selectDisabledImage deselectImage deselectDisabledImage upImage upDisabledImage downImage downDisabledImage |
IAsset |
R | no | If any of these are specified then they override the default images provided
with the component. This allows the look and feel to be customized relatively easily.
The most common reason to replace the images is to deal with backgrounds. The default images are anti-aliased against a white background. If a colored or patterned background is used, the default images will have an ugly white fringe. Until all browsers have full support for PNG (which has a true alpha channel), it is necessary to customize the images to match the background. |
Fields inherited from class com.primix.tapestry.BaseComponent |
outer, OUTER_INIT_SIZE, outerCount |
Fields inherited from class com.primix.tapestry.AbstractComponent |
id, page, specification, wrapped, wrappedCount |
Constructor Summary | |
Palette()
|
Methods inherited from class com.primix.tapestry.BaseComponent |
addOuter, readTemplate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.primix.tapestry.IComponent |
addAsset, addComponent, addWrapped, getAsset, getAssets, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getPage, getSpecification, renderWrapped, setBinding, setContainer, setId, setPage, setSpecification |
Constructor Detail |
public Palette()
Method Detail |
public void finishLoad(IPageLoader loader, ComponentSpecification spec) throws PageLoaderException
IComponent
The exact timing is not specified, but any components contained by the receiving component will also have been constructed before this method is invoked.
As of release 1.0.6, this method is invoked before bindings are set. This should not affect anything, as bindings should only be used during renderring.
finishLoad
in interface IComponent
finishLoad
in class BaseComponent
public void setTableClassBinding(IBinding value)
public IBinding getTableClassBinding()
public void setSelectedTitleBlockBinding(IBinding value)
public IBinding getSelectedTitleBlockBinding()
public void setAvailableTitleBlockBinding(IBinding value)
public IBinding getAvailableTitleBlockBinding()
public void setSelectedBinding(IBinding value)
public IBinding getSelectedBinding()
public void setModelBinding(IBinding value)
public IBinding getModelBinding()
public void setRowsBinding(IBinding value)
public IBinding getRowsBinding()
public int getRows()
public java.lang.String getTableClass()
public void setSortBinding(IBinding value)
public IBinding getSortBinding()
public SortMode getSort()
public java.lang.String getName()
getName
in interface IFormComponent
public IForm getForm()
IFormComponent
Form
which contains the component.getForm
in interface IFormComponent
public void render(IResponseWriter writer, IRequestCycle cycle) throws RequestCycleException
IRender
Renderring and rewinding are the exact same process. The same code that renders must be able to restore state by going through the exact same operations (even though the output is discarded).
render
in interface IRender
render
in class BaseComponent
public java.util.Map getSymbols()
public IRender getAvailableSelectDelegate()
public IRender getSelectedSelectDelegate()
getAvailableSelectDelegate()
, but for the right, selected, column.public boolean isSortUser()
public IAsset getSelectImage()
public IAsset getDeselectImage()
public IAsset getUpImage()
public IAsset getDownImage()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |