|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.tagext.TagSupport net.sf.basedb.clients.web.taglib.table.Table
public class Table
This is the main tag for the table. It must be located inside
a <base:page>
tag.
Syntax:
<tbl:table id=... clazz=.... style=... title=... sortby=... direction=ASC|DESC columns=... sc=... item=... subcontext=... action=... >
Attribute | Default value | Required | Description |
id | - | yes |
The ID of the table. 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:
table = document.getElementById('<id>'); |
clazz | - | 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.
|
title | - | no |
An optional title that will be displayed in <h3>
format directly above the table.
|
sortby | - | no |
Matches the property attribute on a <tbl:columdef> tag.
This column will then be marked with an upwards or downward pointer
according to the |
direction | asc | no |
The value should be either asc or desc to
indicate if the rows are sorted in ascending or descending order.
Other values are interpreted as asc .
|
columns | - | no |
A comma-separatd list of column ID:s. Only columns with an ID in the list
will be shown in the table. The special value all shows all
columns. Individual columns may override this setting by
specifying always or never instead of the default
auto value in their show attribute.
|
action | name of current page | no | The action property of the <form> tag. |
sc | - | no | The current SessionControl object. Used by some child taglibs for generating context sensitive information. |
item | - | no | The current Item object. Used by some child taglibs for generating context sensitive information (ie. PresetSelector). |
subcontext | "" (empty string) | no | The name of the current subcontext. Used by some child taglibs for generating context sensitive information (ie. PresetSelector). |
The <tbl:table>
may contain the following subtags:
<tbl:toolbar>
: Creates a toolbar with buttons
<tbl:navigator>
: Creates the page navigator
<tbl:data>
: Begins the data section
Field Summary | |
---|---|
private String |
action
|
private boolean |
allVisible
"all" was specified for the columns attribute. |
private String |
clazz
Optional class attribute |
private Map<String,String> |
columnContent
|
private Map<String,String> |
columnFilter
|
private Map<String,Formatter<?>> |
columnFormatter
|
private String |
columns
Which columns that should be visible and their order |
private int |
evenodd
Keep track of which class to use for the next row. |
private List<String> |
hiddenFilteredColumns
|
private StringBuilder |
hiddenForm
|
private Item |
itemType
|
private int |
numFilteredColumns
|
private int |
numHeaderColumns
|
private Page |
page
The parent <base:page> tag. |
private static String[] |
rowclass
The class names for even and odd row respectively. |
private SessionControl |
sc
|
private StringBuilder |
script
|
private static long |
serialVersionUID
|
private String |
sortby
The column to sort by. |
private Set<String> |
sortbyMultiple
|
private ItemContext.SortDirection |
sortDirection
ASC or DESC |
private String |
style
Optional style attribute |
private String |
subcontext
|
private String |
title
An optional title of the table. |
private LinkedHashSet<String> |
visibleColumns
The ID of all visible columns, sorted by the order they should appear. |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
Table()
|
Method Summary | |
---|---|
(package private) void |
addColumnDef(ColumnDef cd)
|
(package private) void |
addFilteredColumn(String columnId,
boolean visible)
|
(package private) void |
addHeaderColumn(int colspan)
|
(package private) void |
addHidden(String name,
String value)
|
(package private) void |
addScript(String theScript)
|
int |
doEndTag()
|
int |
doStartTag()
|
String |
getAction()
|
String |
getClazz()
|
(package private) Map<String,String> |
getColumnContent()
|
String |
getColumns()
|
ItemContext.SortDirection |
getDirection()
|
(package private) String |
getDirectionImage()
|
(package private) Formatter<?> |
getFormatter(String columnId)
|
(package private) List<String> |
getHiddenFilteredColumns()
|
Item |
getItem()
|
(package private) String |
getNextRowClass()
|
(package private) int |
getNumFilteredColumns()
|
(package private) Page |
getPage()
|
(package private) ItemContext.SortDirection |
getReverseDirection()
|
SessionControl |
getSc()
|
String |
getSortby()
|
String |
getStyle()
|
String |
getSubcontext()
|
String |
getTitle()
|
(package private) Set<String> |
getVisibleColumns()
|
(package private) boolean |
isColumnVisible(String columnId)
|
(package private) boolean |
isSortedby(String sortcolumn)
|
(package private) int |
numHeaderColumns()
|
(package private) int |
numVisibleColumns()
|
void |
setAction(String action)
|
void |
setClazz(String clazz)
|
(package private) void |
setColumnContent(String columnId,
String content)
|
(package private) void |
setColumnFilter(String columnId,
String filterHtml)
|
void |
setColumns(String columns)
|
void |
setDirection(ItemContext.SortDirection direction)
|
void |
setDirection(String direction)
|
void |
setItem(Item itemType)
|
void |
setSc(SessionControl sc)
|
void |
setSortby(String sortby)
|
void |
setStyle(String style)
|
void |
setSubcontext(String subcontext)
|
void |
setTitle(String title)
|
(package private) void |
writeColumnFilters()
|
(package private) void |
writeColumns()
|
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private Page page
private String clazz
class
attribute
private String style
style
attribute
private String title
private String sortby
private Set<String> sortbyMultiple
private String action
private transient SessionControl sc
private Item itemType
private String subcontext
private ItemContext.SortDirection sortDirection
private String columns
private StringBuilder hiddenForm
private StringBuilder script
private int evenodd
private static final String[] rowclass
private boolean allVisible
private LinkedHashSet<String> visibleColumns
private Map<String,String> columnContent
private Map<String,String> columnFilter
private transient Map<String,Formatter<?>> columnFormatter
private List<String> hiddenFilteredColumns
private int numHeaderColumns
private int numFilteredColumns
Constructor Detail |
---|
public Table()
Method Detail |
---|
public void setClazz(String clazz)
public String getClazz()
public void setStyle(String style)
public String getStyle()
public void setTitle(String title)
public String getTitle()
public void setColumns(String columns)
public String getColumns()
public void setSortby(String sortby)
public String getSortby()
public void setAction(String action)
public String getAction()
public void setSc(SessionControl sc)
public SessionControl getSc()
public void setItem(Item itemType)
public Item getItem()
public void setSubcontext(String subcontext)
public String getSubcontext()
public void setDirection(String direction)
public void setDirection(ItemContext.SortDirection direction)
public ItemContext.SortDirection getDirection()
Page getPage()
void addScript(String theScript)
void addColumnDef(ColumnDef cd)
boolean isColumnVisible(String columnId)
Set<String> getVisibleColumns()
Formatter<?> getFormatter(String columnId)
void setColumnContent(String columnId, String content)
Map<String,String> getColumnContent()
void setColumnFilter(String columnId, String filterHtml)
void addFilteredColumn(String columnId, boolean visible)
List<String> getHiddenFilteredColumns()
void writeColumns() throws Exception
Exception
void writeColumnFilters() throws Exception
Exception
boolean isSortedby(String sortcolumn)
ItemContext.SortDirection getReverseDirection()
String getDirectionImage()
String getNextRowClass()
void addHidden(String name, String value)
int numVisibleColumns()
int getNumFilteredColumns()
void addHeaderColumn(int colspan)
int numHeaderColumns()
public int doStartTag() throws JspException
doStartTag
in interface Tag
doStartTag
in class TagSupport
JspException
public int doEndTag() throws JspException
doEndTag
in interface Tag
doEndTag
in class TagSupport
JspException
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |