--
PedroRio - 16 May 2010
The
ColumnAttribute component is used as child of a
GridPanel (or
BridgePanel) component in order to select which columns should appear. By default
GridPanel instances will show a selection of the attributes of the objects used in the data source. With the
ColumnAttribute component the exact number (and which) of attributes can be selected.
XML Definition:
<xvw:columnAttribute
dataField='name'
....
label='Nome'
>
</xvw:columnAttribute>
Properties
List of Properties of the
ColumnAttribute component:
Property |
Description |
Requirement |
Default Value |
Type |
Note |
dataField |
The attribute from the object to be shown, since ColumnAttribute is a child of Bridge or GridPanel one the attributes from the list of objects they contain can be selected into a column |
Required |
|
String |
|
label |
The label to show in the table header column |
Optional |
|
String |
|
width |
The width of this column (in pixels) |
Optional |
|
Number |
|
hidden |
If the column is hidden or not |
Optional |
False |
Boolean |
|
resizable |
If the column size can be changed |
Optional |
True |
Boolean |
|
sortable |
If the rows can be sorted by the current column |
Optional |
True |
Boolean |
|
renderder |
An implementation of the netgest.bo.xwc.components.classic.GridColumnRenderer interface which allows the column attribute to rendered in a custom way (must |
Optional |
|
GridColumnRenderer |
Must be binded to a bean renderer = '#{viewBean.myRenderer}' |
Property - Renderer:
The renderer property allows the developer to custom render a given column attribute. If one would want to display the value of the column in italic the following should be done.
XML Definition
<xvw:columnAttribute dataField='myFields' renderer='#{viewBean.myRenderer}'>
Java Bean Code
public GridColumnRenderer getMyRenderer() {
return new GridColumnRenderer() {
public String render( GridPanel grid, DataRecordConnector record, DataFieldConnector field ) {
String oValue = field.getValue();
return "<i>" + oValue + "</i>";
}
}
}
To Continue