The following features are supported:
getTable
method will return null
.
@author Jim Menard, jimm@io.com
@see Table
@see DataSource
Component
which renders its contents in a single vertical column of cells. Child LayoutData: Children of this component may provide layout information using the nextapp.echo2.app.layout.ColumnLayoutData
layout data object.
@see nextapp.echo2.app.layout.ColumnLayoutData
|
Table table = new Table("table"); table.setClass("isi"); Column idColumn = new Column("purchaseId", "ID"); idColumn.setFormat("{0,number,#,###}"); table.addColumn(idColumn); Column priceColumn = new Column("purchasePrice", "Price"); priceColumn.setFormat("{0,number,currency}"); priceColumn.setTextAlign("right"); table.addColumn(priceColumn); Column dateColumn = new Column("purchaseDate", "Date"); dateColumn.setFormat("{0,date,dd MMM yyyy}"); table.addColumn(dateColumn); Column orderIdColumn = new Column("order.id", "Order ID"); table.addColumn(orderIdColumn);
Column column = new Column("email"); column.setDecorator(new Decorator() { public String render(Object row, Context context) { Person person = (Person) row; String email = person.getEmail(); String fullName = person.getFullName(); return "<a href='mailto:" + email + "'>" + fullName + "</a>"; } }); table.addColumn(column);The Context parameter of the decorator render() method enables you to render controls to provide additional functionality. For example:
public class CustomerList extends BorderedPage { private Table table = new Table("table"); private ActionLink viewLink = new ActionLink("view"); public CustomerList() { viewLink.setListener(this, "onViewClick"); viewLink.setLabel("View"); viewLink.setAttribute("title", "View customer details"); table.addControl(viewLink); table.addColumn(new Column("id")); table.addColumn(new Column("name")); table.addColumn(new Column("category")); Column column = new Column("Action"); column.setDecorator(new Decorator() { public String render(Object row, Context context) { Customer customer = (Customer) row; viewLink.setValue("" + customer.getId()); return viewLink.toString(); } }); table.addColumn(column); addControl(table); } public boolean onViewClick() { String path = getContext().getPagePath(Logout.class); setRedirect(path + "?id=" + viewLink.getValue()); return true; } }
getName() + ".headerTitle"If not found then the message will be looked up in the /click-control.properties file using the same key. If a value still cannot be found then the Column name will be converted into a header title using the method: {@link ClickUtils#toLabel(String)}. @see Decorator @see Table
This interface inherits from ColumnExpr which provides further metadata.
nodeType
attribute of {@link #getSelectorName selector}. If {@link #getPropertyName property} is specified,{@link #getColumnName columnName} is required and used to name the columnin the tabular results. If {@link #getPropertyName property} is notspecified, {@link #getColumnName columnName} must not be specified, andthe included columns will be named " {@link #getSelectorName selector}.propertyName". The query is invalid if: nodeType
attribute of {@link #getSelectorName selector}. If {@link #getPropertyName property} is specified,{@link #getColumnName columnName} is required and used to name the columnin the tabular results. If {@link #getPropertyName property} is notspecified, {@link #getColumnName columnName} must not be specified, andthe included columns will be named " {@link #getSelectorName selector}.propertyName". The query is invalid if: Java class for column complex type.
The following schema fragment specifies the expected content contained within this class.
<complexType name="column"> <complexContent> <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> <attribute name="column-definition" type="{http://www.w3.org/2001/XMLSchema}string" /> <attribute name="insertable" type="{http://www.w3.org/2001/XMLSchema}boolean" /> <attribute name="length" type="{http://www.w3.org/2001/XMLSchema}int" /> <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" /> <attribute name="nullable" type="{http://www.w3.org/2001/XMLSchema}boolean" /> <attribute name="precision" type="{http://www.w3.org/2001/XMLSchema}int" /> <attribute name="scale" type="{http://www.w3.org/2001/XMLSchema}int" /> <attribute name="table" type="{http://www.w3.org/2001/XMLSchema}string" /> <attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}boolean" /> <attribute name="updatable" type="{http://www.w3.org/2001/XMLSchema}boolean" /> </restriction> </complexContent> </complexType>
以下是可以构建的列的几种形式: 表字段: fieldName1, fieldName2, fieldName3 AS tmpfieldName3 表达式: (fieldName1*100-50) AS tmpfieldName1, (3+2-5) AS tmpfieldName2 SQL了查询: (select table2.fieldName1 from table2 where table2.id = table1.id) AS tmpfieldName1
历史更新记录: 2005-07-30 创建此类型@author wenjian @version 1.0 @since JThink 1.0
Enhanced type checking and conversion by fredt@users @author Thomas Mueller (Hypersonic SQL Group) @author fredt@users @version 1.8.0 @since Hypersonic SQL
Column provides methods to get table cells that belong to this table column.
The use of column is mainly to define attributes for each cell in the grid.
Default {@link #getZclass}: z-column. (since 3.5.0) @author tomyeh
The use of column is mainly to define attributes for each cell in the grid.
Default {@link #getZclass}: z-column. (since 3.5.0) @author tomyeh @since 3.5.2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|