public class ColumnDef extends StylableTag
<tbl:table>
tag.
Syntax:
<tbl:columndef id=... clazz=... style=... property=... sortproperty=... filterproperty=... exportproperty=... datatype=int|long|float|double|string|date|boolean annotation=true|false enumeration=... smartenum=true|false title=... sortable=true|false filterable=true|false exportable=true|false show=always|never|auto tooltip=... formatter=... unit=... >
Attribute | Default value | Required | Description |
id | - | yes |
The ID of the column. Should be unique among the columns in the
table. Do not use all as an ID since it is has a special
meaning. The value of this attribute
goes directly into the standard HTML id attribute.
This means that if you need a reference to the table object in your own
JavaScript code, you may for example use the following code:
column = document.getElementById('<id>');The ID is also used for cross-referencing between the different tags. For example, <tbl:data columns="..."> and
<tbl:cell column="..."> .
|
clazz | columnheader | no |
The value if this attribute goes directly into the standard HTML
class attribute. This allows you to apply different styles
to different tables.
|
style | - | no |
The value if this attribute goes directly into the standard HTML
style attribute. This allows you to apply different styles
to different tables.
|
property | - | no | The name of the property on the item objects of this column. If the property isn't a property of the root item, prepend the value with a dollar sign ($) to indicate that the root alias should not be used when using this property in a query. |
sortproperty | - | no |
The name of the property to sort on when sorting on this column. If
not specified, it takes the same value as the property
value.
|
filterproperty | - | no |
The name of the property to filter on when filtering on this column. If
not specified, it takes the same value as the property
value.
|
exportproperty | - | no |
The name of the property to export on when exporting on this column. If
not specified, it takes the same value as the property
value.
|
title | - | no | The title of the column. The value is displayed in the header row. |
sortable | false | no | If the table can be sorted by this column or not. If a true value is specified the title will be linked to a function that resubmits the page with the new sort order information. |
filterable | false | no | If the table can be filtered by this column or not. |
exportable | no | no | If values in this column can be exported or not. |
show | auto | no |
Specify if this column should be visible or hidden. If the
value is always the column is always shown, if the
value is never the column is never shown, if the value
is auto it is only shown if it appears in the
columns attribute of the <tbl:data>
tag.
|
enumeration | - | no | A Enumeration<String, String> object containing the possible values of this property. This is used to generate a selection list for the filter. |
smartenum | false | no | If the filter for an enumeration column should be displayed as a free text field or a selection list. Default is to use a selection list. Use this option only if both the hidden key and the displayed value of the enumeration is the same. The "smartness" of this options is that as the user types text, the browser will dynamically display a list of options matching the entered text. |
multiple | true | no | If it should be possible to select multiple options for an 'enumeration' or only a single option. The default value is true. |
formatter | - | no | A Formatter that formats the values in this column. If no formatter
is specified the value is ouput as is. Values that should be formated must
be specified in the <cell value="..."> attribute. Any tag content
is outputted as entered.
|
unit | - | no |
An options Unit object that should be unit the values are
stored with in the database. Setting this property enables
filter expressions with units.
|
This tag has no subtags.
Modifier and Type | Field and Description |
---|---|
private Enumeration<java.lang.String,java.lang.String> |
enumeration
Options for enum.
|
private boolean |
exportable
If the column is exportable or not
|
private java.lang.String |
exportProperty
Optional property used for exporting.
|
private ExtensionsInvoker<ListColumnAction> |
extensions |
private boolean |
filterable
If the column is filterable or not
|
private java.lang.String |
filterProperty
Optional property used for filtering.
|
private Formatter<?> |
formatter |
private boolean |
isAnnotation
If the property is an annotation or not.
|
private JspContext |
jspContext |
private boolean |
multiple |
private java.lang.String |
property
The name of the property on the item class.
|
private static long |
serialVersionUID |
private java.lang.String |
show
If the column should be visible or not.
|
private boolean |
smartEnum |
private boolean |
sortable
If the column is sortable or not
|
private java.lang.String |
sortProperty
Optional property used for sorting.
|
private Table |
table
The parent <tbl:table> tag.
|
private java.lang.String |
title
The title of the column.
|
private java.lang.String |
tooltip
A tooltip with explaining text.
|
private Unit |
unit |
private Type |
valueType
The type of data in the property.
|
id, pageContext
EVAL_BODY_AGAIN
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
Constructor and Description |
---|
ColumnDef() |
Modifier and Type | Method and Description |
---|---|
private void |
appendPermissionOption(java.lang.StringBuilder sb,
Permission selected,
Permission toAdd,
java.lang.String display) |
org.json.simple.JSONObject |
asJsonObject()
Get a JSON representation of this column definition.
|
int |
doStartTag() |
java.lang.String |
getDatatype() |
Enumeration<java.lang.String,java.lang.String> |
getEnumeration() |
java.lang.String |
getExportproperty() |
java.lang.String |
getFilterproperty() |
Formatter<?> |
getFormatter() |
protected java.lang.String |
getIdPrefix()
Optional prefix to include in the 'id' attribute.
|
java.lang.String |
getProperty() |
java.lang.String |
getShow() |
java.lang.String |
getSortproperty() |
java.lang.String |
getTitle() |
java.lang.String |
getTooltip() |
Unit |
getUnit() |
Type |
getValueType() |
boolean |
isAnnotation() |
boolean |
isExportable() |
boolean |
isFilterable() |
boolean |
isSortable() |
void |
setAnnotation(boolean isAnnotation) |
void |
setDatatype(java.lang.String dataType) |
void |
setEnumeration(Enumeration<java.lang.String,java.lang.String> enumeration) |
void |
setExportable(boolean exportable) |
void |
setExportproperty(java.lang.String exportProperty) |
void |
setExtensions(ExtensionsInvoker<ListColumnAction> extensions) |
void |
setFilterable(boolean filterable) |
void |
setFilterproperty(java.lang.String filterProperty) |
void |
setFormatter(Formatter<?> formatter) |
void |
setJspcontext(JspContext jspContext) |
void |
setMultiple(boolean multiple) |
void |
setProperty(java.lang.String property) |
void |
setShow(java.lang.String show) |
void |
setSmartenum(boolean smartEnum) |
void |
setSortable(boolean sortable) |
void |
setSortproperty(java.lang.String sortProperty) |
void |
setTitle(java.lang.String title) |
void |
setTooltip(java.lang.String tooltip) |
void |
setUnit(Unit unit) |
void |
setValueType(Type valueType) |
addDynamicAttributes, addIdAndStyles, getClazz, getDynamicActionAttributes, getDynamicAttribute, getFullClass, getStyle, getSubclass, initDefaultAttributes, setClazz, setDynamicAttribute, setMoreDynamicAttributes, setPageContext, setStyle, setSubclass
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setParent, setValue
private static final long serialVersionUID
private Table table
private java.lang.String property
private boolean isAnnotation
private java.lang.String sortProperty
private java.lang.String filterProperty
private java.lang.String exportProperty
private Type valueType
private java.lang.String title
private java.lang.String show
private boolean sortable
private boolean filterable
private boolean exportable
private java.lang.String tooltip
private Enumeration<java.lang.String,java.lang.String> enumeration
private boolean smartEnum
private boolean multiple
private transient Formatter<?> formatter
private transient Unit unit
private JspContext jspContext
private ExtensionsInvoker<ListColumnAction> extensions
public void setProperty(java.lang.String property)
public java.lang.String getProperty()
public void setAnnotation(boolean isAnnotation)
public boolean isAnnotation()
public void setSortproperty(java.lang.String sortProperty)
public java.lang.String getSortproperty()
public void setFilterproperty(java.lang.String filterProperty)
public java.lang.String getFilterproperty()
public void setExportproperty(java.lang.String exportProperty)
public java.lang.String getExportproperty()
public void setDatatype(java.lang.String dataType)
public java.lang.String getDatatype()
public void setValueType(Type valueType)
public Type getValueType()
public void setTitle(java.lang.String title)
public java.lang.String getTitle()
public void setShow(java.lang.String show)
public java.lang.String getShow()
public void setSortable(boolean sortable)
public boolean isSortable()
public void setFilterable(boolean filterable)
public boolean isFilterable()
public void setExportable(boolean exportable)
public boolean isExportable()
public void setTooltip(java.lang.String tooltip)
public java.lang.String getTooltip()
public void setEnumeration(Enumeration<java.lang.String,java.lang.String> enumeration)
public Enumeration<java.lang.String,java.lang.String> getEnumeration()
public void setMultiple(boolean multiple)
public void setSmartenum(boolean smartEnum)
public void setFormatter(Formatter<?> formatter)
public Formatter<?> getFormatter()
public void setUnit(Unit unit)
public Unit getUnit()
public void setJspcontext(JspContext jspContext)
public void setExtensions(ExtensionsInvoker<ListColumnAction> extensions)
protected java.lang.String getIdPrefix()
StylableTag
StylableTag.addIdAndStyles(StringBuilder, String...)
.getIdPrefix
in class StylableTag
public org.json.simple.JSONObject asJsonObject()
public int doStartTag() throws JspException
doStartTag
in interface Tag
doStartTag
in class TagSupport
JspException
private void appendPermissionOption(java.lang.StringBuilder sb, Permission selected, Permission toAdd, java.lang.String display)