Home » tapestry-src-5.0.19 » org.apache.tapestry5.corelib.components » [javadoc | source]
public class: Palette [javadoc | source]

All Implemented Interfaces:

Multiple selection component. Generates a UI consisting of two <select> elements configured for multiple selection; the one on the left is the list of "available" elements, the one on the right is "selected". Elements can be moved between the lists by clicking a button, or double clicking an option (and eventually, via drag and drop).

The items in the available list are kept ordered as per SelectModel order. When items are moved from the selected list to the available list, they items are inserted back into their proper positions.

The Palette may operate in normal or re-orderable mode, controlled by the reorder parameter.

In normal mode, the items in the selected list are kept in the same "natural" order as the items in the available list.

In re-order mode, items moved to the selected list are simply added to the bottom of the list. In addition, two extra buttons appear to move items up and down within the selected list.

Much of the look and feel is driven by CSS, the default Tapestry CSS is used to set up the columns, etc. By default, the <select> element's widths are 200px, and it is common to override this to a specific value:

DIV.t-palette SELECT { width: 300px; }

You'll want to ensure that both <select> in each column is the same width, otherwise the display will update poorly as options are moved from one column to the other.

Option groups within the SelectModel will be rendered, but are not supported by many browsers, and are not fully handled on the client side.
Method from org.apache.tapestry5.corelib.components.Palette Summary:
beforeRenderBody,   beginRender,   getAvailableRenderer,   getSelected,   getSelectedRenderer,   getSize,   processSubmission,   setupRender,   toClient
Methods from org.apache.tapestry5.corelib.base.AbstractField:
afterDecorator,   beforeDecorator,   createDefaultParameterBinding,   decorateInsideField,   defaultLabel,   getClientId,   getControlName,   getLabel,   isDisabled,   isRequired,   processSubmission,   setDecorator,   setFormSupport,   setup
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tapestry5.corelib.components.Palette Detail:
 boolean beforeRenderBody() 
    Prevent the body from rendering.
  void beginRender(MarkupWriter writer) 
 public Renderable getAvailableRenderer() 
 List<Object> getSelected() 
 public Renderable getSelectedRenderer() 
 int getSize() 
 protected  void processSubmission(String elementName) 
  void setupRender(MarkupWriter writer) 
 String toClient(Object value)