com.oktiva.mogno.additional
Class TableList

java.lang.Object
  extended bycom.oktiva.mogno.Component
      extended bycom.oktiva.mogno.Visual
          extended bycom.oktiva.mogno.Container
              extended bycom.oktiva.mogno.html.Table
                  extended bycom.oktiva.mogno.additional.TableList
All Implemented Interfaces:
java.lang.Cloneable

public class TableList
extends Table

Creates a list with a table (supporting a link with onClick).
This component takes the data in the dataVector property and creates a table where the lines are used as the items itself, with links in one or more columns.
If this TableList is active, the id passed for each row's Vector will be used as the identificator for the item in the link.

Version:
$Id: TableList.java,v 1.1.1.1 2005/01/05 16:53:01 ruoso Exp $

Field Summary
 boolean active
          Activate/deactivate this TableList.
 boolean allowMultiple
          if true and active, a checkbox will be shown for each line
 java.lang.String applicationUrl
          The url of this web application
 java.lang.String colgroups
          The HTML code with COLGROUPs and COLs.
 java.lang.String columnIdentifiers
          String with the comumn's names, in the following format:
name1&name2&name3...
protected  java.util.Vector dataVector
          Vector of Vectors with the table data.
 java.lang.String evOnClick
          Event dispatched when a row's link is clicked.
protected  java.util.Vector groupIdVector
          Vector with the groupId of each row.
protected  java.util.Vector groupVector
          Vector with the data for TBODYs, THEADs and TFOOTs.
 java.lang.String headerGroupId
          The header row group id.
 java.lang.String headerGroupType
          The header row group type.
 java.lang.String headerRowProperties
          Properties of the Tr of the table header, in the following format:
attr1=val1|attr2=val2|attr3=val3...
protected  java.util.Vector idVector
          Vector with the item's ids.
 java.lang.String itemRowProperties
          Properties of the Tr's of the table body, in the following format:
attr1=val1|attr2=val2|attr3=val3...
 java.lang.String linkColumns
          The number of the columns where there will be the link, separated by &.
 java.lang.String origin
          The mognoOrigin param, defaults to owner.name.
 java.lang.String params
          Another params (in URL encoded format) to add to the link
 java.util.Vector selectedItens
          The seleeted itens
 java.lang.String tdProperties
          Properties of the Td's of the table body, in the following format:
col1attr1=val1|col1attr2=val2&col2attr3=val3...
 java.lang.String thProperties
          Properties of the Th's of the table header, in the following format:
col1attr1=val1|col1attr2=val2&col2attr3=val3...
 java.lang.String totalColumns
          The number of the columns taht will be totalized, separated by &.
 java.lang.String totalLineGroupId
          The total row group id.
 java.lang.String totalLineGroupType
          The total row group type.
 java.lang.String totalLineLabel
          The String that will be displayed in the first column of the total line
 int totalMaximumFractionDigits
          The max number of fractionary digists given to DecimalFormat
 int totalMinimumFractionDigits
          The minimum number of fractionary digists given to DecimalFormat
 
Fields inherited from class com.oktiva.mogno.html.Table
align, border, cellpadding, cellspacing, dir, frame, lang, onclick, ondblclick, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup, rules, summary, width
 
Fields inherited from class com.oktiva.mogno.Container
afterEnd, content
 
Fields inherited from class com.oktiva.mogno.Visual
evOnShow, evOnSyntaxError, gridHeight, gridWeightX, gridWeightY, gridWidth, id, lastError, left, parent, problematic, style, styleClass, title, top
 
Fields inherited from class com.oktiva.mogno.Component
bag, componentFiler, componentFilerParams, designing, eventQueue, evOnCreate, name, owned, ownedClasses, owner, tag, xmlFileName
 
Constructor Summary
TableList()
           
 
Method Summary
 void addRowData(java.util.Vector rowData)
          Add a row data whithout an associated id.
 void addRowData(java.util.Vector rowData, java.lang.String id)
          Add a row data and the associated id.
 void addRowData(java.util.Vector rowData, java.lang.String groupType, java.lang.String groupId)
          Add a row data with the data of the "group" it is in, whithout an associated id.
 void addRowData(java.util.Vector rowData, java.lang.String groupType, java.lang.String groupId, java.lang.String id)
          Add a row data with the data of the "group" it is in, and the associated id.
 java.lang.String endContainer()
          Ends container's tag.
 boolean getActive()
           
 java.lang.String getApplicationUrl()
           
 java.lang.String getColgroups()
          Getter for property colgroups.
 java.lang.String getColumnIdentifiers()
           
 java.util.Vector getDataVector()
          Getter for property dataVector.
 java.lang.String getEvOnClick()
           
 java.lang.String getHeaderGroupId()
          Getter for property headerGroupId.
 java.lang.String getHeaderGroupType()
          Getter for property headerGroupType.
 java.lang.String getHeaderRowProperties()
          Getter for property headerRowProperties.
 java.lang.String getItemRowProperties()
          Getter for property itemRowProperties.
 java.lang.String getLinkColumns()
          Getter for property linkColumns.
 java.lang.String getOrigin()
           
 java.lang.String getParams()
           
protected  java.util.Hashtable getPropertiesHash(java.lang.String propString)
           
protected  java.lang.String getPropertiesHtmlString(java.lang.String propString)
           
 java.lang.String getSelectedItem()
           
 java.util.Vector getSelectedItens()
           
 java.lang.String getTdProperties()
          Getter for property tdProperties.
 java.lang.String getThProperties()
          Getter for property thProperties.
 java.lang.String getTotalColumns()
          Getter for property totalColumns.
 java.lang.String getTotalLineGroupId()
          Getter for property totalLineGroupId.
 java.lang.String getTotalLineGroupType()
          Getter for property totalLineGroupType.
 java.lang.String getTotalLineLabel()
          Getter for property totalLineLabel.
 int getTotalMaximumFractionDigits()
          Getter for property totalMaximumFractionDigits.
 int getTotalMinimumFractionDigits()
          Getter for property totalMinimumFractionDigits.
 boolean isAllowMultiple()
           
 void receiveRequest(javax.servlet.http.HttpServletRequest request)
          Receive the request and rebuild the properties using the data that the user has filled in.
 Component selectParentComponent()
          The parent component: this one or his owner.
 void setActive(boolean active)
           
 void setAllowMultiple(boolean newAllowMultiple)
           
 void setApplicationUrl(java.lang.String applicationUrl)
           
 void setColgroups(java.lang.String colgroups)
          Setter for property colgroups.
 void setColumnIdentifiers(java.lang.String columnIdentifiers)
           
 void setDataVector(java.util.Vector dataVector)
          Setter for property dataVector.
 void setEvOnClick(java.lang.String evOnClick)
           
 void setHeaderGroupId(java.lang.String headerGroupId)
          Setter for property headerGroupId.
 void setHeaderGroupType(java.lang.String headerGroupType)
          Setter for property headerGroupType.
 void setHeaderRowProperties(java.lang.String headerRowProperties)
          Setter for property headerRowProperties.
 void setItemRowProperties(java.lang.String itemRowProperties)
          Setter for property itemRowProperties.
 void setLinkColumns(java.lang.String linkColumns)
          Setter for property linkColumns.
 void setOrigin(java.lang.String origin)
           
 void setParams(java.lang.String params)
           
protected  void setPropertiesFromString(Component c, java.lang.String propString)
           
 void setSelectedItem(java.lang.String selectedItem)
           
 void setSelectedItens(java.util.Vector newSelectedItens)
           
 void setTdProperties(java.lang.String tdProperties)
          Setter for property tdProperties.
 void setThProperties(java.lang.String thProperties)
          Setter for property thProperties.
 void setTotalColumns(java.lang.String totalColumns)
          Setter for property totalColumns.
 void setTotalLineGroupId(java.lang.String totalLineGroupId)
          Setter for property totalLineGroupId.
 void setTotalLineGroupType(java.lang.String totalLineGroupType)
          Setter for property totalLineGroupType.
 void setTotalLineLabel(java.lang.String totalLineLabel)
          Setter for property totalLineLabel.
 void setTotalMaximumFractionDigits(int totalMaximumFractionDigits)
          Setter for property totalMaximumFractionDigits.
 void setTotalMinimumFractionDigits(int totalMinimumFractionDigits)
          Setter for property totalMinimumFractionDigits.
 java.lang.String show()
          Builds the HTML from the ordered childs list.
 
Methods inherited from class com.oktiva.mogno.html.Table
getAlign, getBorder, getCellpadding, getCellspacing, getDir, getFrame, getLang, getOnclick, getOndblclick, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getRules, getSummary, getWidth, htmlAttributes, setAlign, setBorder, setCellpadding, setCellspacing, setDir, setFrame, setLang, setOnclick, setOndblclick, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setRules, setSummary, setWidth
 
Methods inherited from class com.oktiva.mogno.Container
addChildsVector, betweenColumns, betweenRows, endColumn, endRow, getChildsVector, getContent, getFullComponentsVector, getOrderedChildNames, getOrderedChildsVector, nonAttributeGetters, orderChildsVector, setContent, startColumn, startContainer, startRow
 
Methods inherited from class com.oktiva.mogno.Visual
buildHtmlAttributes, cellhalignHtmlAttributes, cellvalignHtmlAttributes, checkSyntax, coreHtmlAttributes, descendentOf, eventsHtmlAttributes, getEvOnShow, getEvOnSyntaxError, getGridHeight, getGridWeightX, getGridWeightY, getGridWidth, getId, getLastError, getLeft, getParent, getStyle, getStyleClass, getTitle, getTop, i18nHtmlAttributes, localizableAttributes, setEvOnShow, setEvOnSyntaxError, setGridHeight, setGridWeightX, setGridWeightY, setGridWidth, setId, setLastError, setLeft, setParent, setStyle, setStyleClass, setTitle, setTop, showHtmlAttributes
 
Methods inherited from class com.oktiva.mogno.Component
attribsHash, createOwnedComponents, dispatch, dispatchAll, dispatchFunction, eventParamTypes, eventParamValues, freeChild, getApplication, getAttrsTypes, getBag, getChild, getChildClass, getClone, getEvOnCreate, getFromBag, getName, getOwner, initialize, initialize, initialize, initialize, isDesigning, listChilds, putInBag, queue, registerChild, removeFromBag, serializedBag, setBag, setComponentFiler, setComponentFilerParams, setDesigning, setEvOnCreate, setName, setOwner, setProperties, store, unserializeBag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

idVector

protected java.util.Vector idVector
Vector with the item's ids.


dataVector

protected java.util.Vector dataVector
Vector of Vectors with the table data.


colgroups

public java.lang.String colgroups
The HTML code with COLGROUPs and COLs.


groupVector

protected java.util.Vector groupVector
Vector with the data for TBODYs, THEADs and TFOOTs.


groupIdVector

protected java.util.Vector groupIdVector
Vector with the groupId of each row.


headerGroupType

public java.lang.String headerGroupType
The header row group type. A String that can be TBODY, THEAD or TFOOT.


headerGroupId

public java.lang.String headerGroupId
The header row group id. Any String that will identify all the rows inside de same group.


totalLineGroupType

public java.lang.String totalLineGroupType
The total row group type. A String that can be TBODY, THEAD or TFOOT.


totalLineGroupId

public java.lang.String totalLineGroupId
The total row group id. Any String that will identify all the rows inside de same group.


columnIdentifiers

public java.lang.String columnIdentifiers
String with the comumn's names, in the following format:
name1&name2&name3... Limited to 64 columns, due to internal optimizations.


totalLineLabel

public java.lang.String totalLineLabel
The String that will be displayed in the first column of the total line


totalColumns

public java.lang.String totalColumns
The number of the columns taht will be totalized, separated by &.


totalMaximumFractionDigits

public int totalMaximumFractionDigits
The max number of fractionary digists given to DecimalFormat


totalMinimumFractionDigits

public int totalMinimumFractionDigits
The minimum number of fractionary digists given to DecimalFormat


linkColumns

public java.lang.String linkColumns
The number of the columns where there will be the link, separated by &.
Defaults to the first column. Column numbers starts with 1.


headerRowProperties

public java.lang.String headerRowProperties
Properties of the Tr of the table header, in the following format:
attr1=val1|attr2=val2|attr3=val3...
Example: style=color: #808080;|valign=top

See Also:
Tr

thProperties

public java.lang.String thProperties
Properties of the Th's of the table header, in the following format:
col1attr1=val1|col1attr2=val2&col2attr3=val3...
Example: style=color: #808080; width=30%;|align=left&style=width=70%|align=right

See Also:
Th

itemRowProperties

public java.lang.String itemRowProperties
Properties of the Tr's of the table body, in the following format:
attr1=val1|attr2=val2|attr3=val3...
Example: styleClass=myRowStyle;

See Also:
Tr

tdProperties

public java.lang.String tdProperties
Properties of the Td's of the table body, in the following format:
col1attr1=val1|col1attr2=val2&col2attr3=val3...
Example: style=background-color: #ffffff;|align=left&align=right

See Also:
Td

selectedItens

public java.util.Vector selectedItens
The seleeted itens


active

public boolean active
Activate/deactivate this TableList. An inactive TableList doesn't have a link.


allowMultiple

public boolean allowMultiple
if true and active, a checkbox will be shown for each line


applicationUrl

public java.lang.String applicationUrl
The url of this web application


params

public java.lang.String params
Another params (in URL encoded format) to add to the link


origin

public java.lang.String origin
The mognoOrigin param, defaults to owner.name.


evOnClick

public java.lang.String evOnClick
Event dispatched when a row's link is clicked.

Constructor Detail

TableList

public TableList()
Method Detail

getColumnIdentifiers

public java.lang.String getColumnIdentifiers()

setColumnIdentifiers

public void setColumnIdentifiers(java.lang.String columnIdentifiers)

getSelectedItens

public java.util.Vector getSelectedItens()

setSelectedItens

public void setSelectedItens(java.util.Vector newSelectedItens)

getSelectedItem

public java.lang.String getSelectedItem()

setSelectedItem

public void setSelectedItem(java.lang.String selectedItem)

getActive

public boolean getActive()

setActive

public void setActive(boolean active)

isAllowMultiple

public boolean isAllowMultiple()

setAllowMultiple

public void setAllowMultiple(boolean newAllowMultiple)

getApplicationUrl

public java.lang.String getApplicationUrl()

setApplicationUrl

public void setApplicationUrl(java.lang.String applicationUrl)

getParams

public java.lang.String getParams()

setParams

public void setParams(java.lang.String params)

getOrigin

public java.lang.String getOrigin()

setOrigin

public void setOrigin(java.lang.String origin)

getEvOnClick

public java.lang.String getEvOnClick()

setEvOnClick

public void setEvOnClick(java.lang.String evOnClick)

selectParentComponent

public Component selectParentComponent()
Description copied from class: Container
The parent component: this one or his owner.

Overrides:
selectParentComponent in class Container
Returns:
(Component)owner==null?this:owner

show

public java.lang.String show()
                      throws java.lang.Exception
Description copied from class: Container
Builds the HTML from the ordered childs list. When a component has gridWidth or gridHeight, the number of startColumns, endColumns, startRow and endRows called will still depend of the last top and left. Ex.: If you have a component with left 0 and gridWidth 2 and you have another component with left 2, there will be three calls to startColumn

Overrides:
show in class Container
Throws:
java.lang.Exception

setPropertiesFromString

protected void setPropertiesFromString(Component c,
                                       java.lang.String propString)

getPropertiesHash

protected java.util.Hashtable getPropertiesHash(java.lang.String propString)

getPropertiesHtmlString

protected java.lang.String getPropertiesHtmlString(java.lang.String propString)

endContainer

public java.lang.String endContainer()
Description copied from class: Container
Ends container's tag.
If the tag attribute is not null, assumes the default behavior:
< + tag + htmlAttributes + >

Overrides:
endContainer in class Container
Returns:
String

receiveRequest

public void receiveRequest(javax.servlet.http.HttpServletRequest request)
Description copied from class: Visual
Receive the request and rebuild the properties using the data that the user has filled in. This is a stub method

Overrides:
receiveRequest in class Visual
Parameters:
request - HttpServletRequest

addRowData

public void addRowData(java.util.Vector rowData)
Add a row data whithout an associated id.
NOTE: Do not use if this TableList is active!

Parameters:
rowData - A Vector with the row data.
See Also:
active

addRowData

public void addRowData(java.util.Vector rowData,
                       java.lang.String id)
Add a row data and the associated id. If this TableList is not active, the id will be ignored.

Parameters:
rowData - A Vector with the row data.
id - The associated id.
See Also:
active

addRowData

public void addRowData(java.util.Vector rowData,
                       java.lang.String groupType,
                       java.lang.String groupId)
Add a row data with the data of the "group" it is in, whithout an associated id.
NOTE: Do not use if this TableList is active!

Parameters:
groupType - A String that can be TBODY, THEAD or TFOOT.
groupId - Any String that will identify all the rows inside de same group.
rowData - A Vector with the row data.
See Also:
active

addRowData

public void addRowData(java.util.Vector rowData,
                       java.lang.String groupType,
                       java.lang.String groupId,
                       java.lang.String id)
Add a row data with the data of the "group" it is in, and the associated id. If this TableList is not active, the id will be ignored.

Parameters:
groupType - A String that can be TBODY, THEAD or TFOOT.
groupId - Any String that will identify all the rows inside de same group.
rowData - A Vector with the row data.
id - The associated id.
See Also:
active

getDataVector

public java.util.Vector getDataVector()
Getter for property dataVector.

Returns:
Value of property dataVector.

setDataVector

public void setDataVector(java.util.Vector dataVector)
Setter for property dataVector.

Parameters:
dataVector - New value of property dataVector.

getHeaderRowProperties

public java.lang.String getHeaderRowProperties()
Getter for property headerRowProperties.

Returns:
Value of property headerRowProperties.

setHeaderRowProperties

public void setHeaderRowProperties(java.lang.String headerRowProperties)
Setter for property headerRowProperties.

Parameters:
headerRowProperties - New value of property headerRowProperties.

getThProperties

public java.lang.String getThProperties()
Getter for property thProperties.

Returns:
Value of property thProperties.

setThProperties

public void setThProperties(java.lang.String thProperties)
Setter for property thProperties.

Parameters:
thProperties - New value of property thProperties.

getItemRowProperties

public java.lang.String getItemRowProperties()
Getter for property itemRowProperties.

Returns:
Value of property itemRowProperties.

setItemRowProperties

public void setItemRowProperties(java.lang.String itemRowProperties)
Setter for property itemRowProperties.

Parameters:
itemRowProperties - New value of property itemRowProperties.

getTdProperties

public java.lang.String getTdProperties()
Getter for property tdProperties.

Returns:
Value of property tdProperties.

setTdProperties

public void setTdProperties(java.lang.String tdProperties)
Setter for property tdProperties.

Parameters:
tdProperties - New value of property tdProperties.

getLinkColumns

public java.lang.String getLinkColumns()
Getter for property linkColumns.

Returns:
Value of property linkColumns.

setLinkColumns

public void setLinkColumns(java.lang.String linkColumns)
Setter for property linkColumns.

Parameters:
linkColumns - New value of property linkColumns.

getTotalLineLabel

public java.lang.String getTotalLineLabel()
Getter for property totalLineLabel.

Returns:
Value of property totalLineLabel.

setTotalLineLabel

public void setTotalLineLabel(java.lang.String totalLineLabel)
Setter for property totalLineLabel.

Parameters:
totalLineLabel - New value of property totalLineLabel.

getTotalColumns

public java.lang.String getTotalColumns()
Getter for property totalColumns.

Returns:
Value of property totalColumns.

setTotalColumns

public void setTotalColumns(java.lang.String totalColumns)
Setter for property totalColumns.

Parameters:
totalColumns - New value of property totalColumns.

getTotalMaximumFractionDigits

public int getTotalMaximumFractionDigits()
Getter for property totalMaximumFractionDigits.

Returns:
Value of property totalMaximumFractionDigits.

setTotalMaximumFractionDigits

public void setTotalMaximumFractionDigits(int totalMaximumFractionDigits)
Setter for property totalMaximumFractionDigits.

Parameters:
totalMaximumFractionDigits - New value of property totalMaximumFractionDigits.

getTotalMinimumFractionDigits

public int getTotalMinimumFractionDigits()
Getter for property totalMinimumFractionDigits.

Returns:
Value of property totalMinimumFractionDigits.

setTotalMinimumFractionDigits

public void setTotalMinimumFractionDigits(int totalMinimumFractionDigits)
Setter for property totalMinimumFractionDigits.

Parameters:
totalMinimumFractionDigits - New value of property totalMinimumFractionDigits.

getColgroups

public java.lang.String getColgroups()
Getter for property colgroups.

Returns:
Value of property colgroups.

setColgroups

public void setColgroups(java.lang.String colgroups)
Setter for property colgroups.

Parameters:
colgroups - New value of property colgroups.

getHeaderGroupType

public java.lang.String getHeaderGroupType()
Getter for property headerGroupType.

Returns:
Value of property headerGroupType.

setHeaderGroupType

public void setHeaderGroupType(java.lang.String headerGroupType)
Setter for property headerGroupType.

Parameters:
headerGroupType - New value of property headerGroupType.

getHeaderGroupId

public java.lang.String getHeaderGroupId()
Getter for property headerGroupId.

Returns:
Value of property headerGroupId.

setHeaderGroupId

public void setHeaderGroupId(java.lang.String headerGroupId)
Setter for property headerGroupId.

Parameters:
headerGroupId - New value of property headerGroupId.

getTotalLineGroupType

public java.lang.String getTotalLineGroupType()
Getter for property totalLineGroupType.

Returns:
Value of property totalLineGroupType.

setTotalLineGroupType

public void setTotalLineGroupType(java.lang.String totalLineGroupType)
Setter for property totalLineGroupType.

Parameters:
totalLineGroupType - New value of property totalLineGroupType.

getTotalLineGroupId

public java.lang.String getTotalLineGroupId()
Getter for property totalLineGroupId.

Returns:
Value of property totalLineGroupId.

setTotalLineGroupId

public void setTotalLineGroupId(java.lang.String totalLineGroupId)
Setter for property totalLineGroupId.

Parameters:
totalLineGroupId - New value of property totalLineGroupId.