Class ServerTableView
java.lang.Object
overit.geocall.platform.ui.UINode
overit.geocall.ui.Component
overit.geocall.ui.Control
overit.geocall.basic.ui.Container
overit.geocall.basic.ui.container.TableView
overit.geocall.basic.ui.container.ServerTableView
- All Implemented Interfaces:
Serializable,EntityContainer,overit.geocall.clipboard.XClip,overit.geocall.marks.MethodExposer,overit.geocall.marks.NameExposer,AjaxableComponent,Badgeable,DAViewManager,DBViewManager,DraggableDroppable,Hideable,Identified,Tool,overit.geocall.ux.configurability.UIConfigurable,overit.geocall.ux.edm.ModelConfigurable
- Direct Known Subclasses:
CalendarView,CardView,EventServerTableView,ServerTableViewWithCount,SynchronizedPlanningMonitorTableView
The class extends
The ServerTableView it's the "server table", the component that can be used to keep all data in memory or, if the amount of data is big, load the data on demand. Furthermore this container, being managed on server side, provides a whole series of additional interactions and better user interface behaviors that make it the right object to use to create tables in all the application.
TableView and implements a table, the user interface element that allows to arranges
the data in tabular format and manages the behaviors of the child components, that are mainly columns and some particular kind of buttons. The ServerTableView it's the "server table", the component that can be used to keep all data in memory or, if the amount of data is big, load the data on demand. Furthermore this container, being managed on server side, provides a whole series of additional interactions and better user interface behaviors that make it the right object to use to create tables in all the application.
- See Also:
- GCApi:
- component
-
Nested Class Summary
Nested classes/interfaces inherited from class overit.geocall.basic.ui.container.TableView
TableView.SelectionNested classes/interfaces inherited from class overit.geocall.ui.Component
Component.Configurable, Component.ConfigurableAttribute, Component.ConfigurableAttributes, Component.FilterCriteria, Component.Registry -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DABaseprotected DAOprotected DAO0protected intprotected intprotected booleanprotected intprotected Stringprotected HashGetterprotected Commandprotected booleanprotected intprotected booleanFields inherited from class overit.geocall.basic.ui.container.TableView
_activeMode, _advancedLayout, _alRowMessages, _alTableMessages, _alTableOrders, _anchor, _begin, _bkgColorName, _bkgColorSwitch, _changedMetaData, _columns, _columnsOrigin, _contentFrame, _cutname, _cutting, _cuttingRow, _dbv, _draggable, _droppable, _end, _event, _event2, _eventmode, _eventr, _footerLastRow, _footerValues, _forceFirstPage, _from, _fullsize, _height, _hiddenCols, _lastSelected, _minWidth, _msg, _msg2, _msgr, _page, _param, _param2, _paramr, _query, _requestedMode, _rows, _selection, _selectionRow, _selectname, _selectset, _someThingDraggable, _somethingHidden, _titleFormat, _to, _visible, _xclass, configurableRows, editable, extensionTabIndex, hiddenProfileCols, navBarTabIndex, NOT_IDENTIFIED_COLUMN_PLACEHOLDER, PARAM_KEY, TABLE_CONFIGURABILITY_PANEL_PATH, TABLE_FIELDS_OBJECT_NAME, TABLE_OBJ_TEMP_PREFIX, TABLE_WIDGET_ATTRIBUTES_OBJECT, TABLE_WIDGET_STATE_CLASSFields inherited from class overit.geocall.basic.ui.Container
_rofields, _rules, DALINK_NO, DALINK_YES, DATE_MAX, DATE_MIN, TIME_MAX, TIME_MIN, TYPE_ACTION, TYPE_BOOLEAN, TYPE_DATE, TYPE_DOUBLE, TYPE_DTZ, TYPE_EURO, TYPE_FILE, TYPE_FILES, TYPE_INTEGER, TYPE_LONG, TYPE_LONGARRAY, TYPE_MAP, TYPE_MAXDATE, TYPE_MAXTIME, TYPE_MEASURE, TYPE_MINDATE, TYPE_MINTIME, TYPE_NEWACTION, TYPE_STRING, TYPE_STRINGARRAY, TYPE_SUBSET, TYPE_SUBSETRANGE, TYPE_SUPPORT, TYPE_TIMERANGEFields inherited from class overit.geocall.ui.Control
_blank, _cleaner, _dblink, _enabled, _ro, _title, altEventIconsList, altIcon, ariaDescription, ariaLabel, badge, badgeformat, FILTER_PREFIXES, LABEL_ATTRIBUTE, LABEL_IN_LINE_ATTRIBUTE, STATE_BLANK, STATE_NORMAL, STATE_RO, STATE_ROBLANKFields inherited from class overit.geocall.ui.Component
_basic, _childrenContainers, _currentId, _gridalign, _gridcols, _gridrows, _gridvalign, _iconElement, _id, _keylabel, _label, _layoutName, _name, _parentContainer, _registryName, _shortcut, _tabindex, _transformations, _valuesContainer, aliasField, BR, configHidden, configuredLabel, configuredLabelInLine, defaultHidden, ELEMENT_BR, ELEMENT_NULL, entityContainer, entityName, extendedField, fullHeight, important, labelInLine, layoutLabel, PIXEL_IMG, safeInlineServiceFields inherited from interface overit.geocall.ui.AjaxableComponent
FRAME_ID_PREFIX, NOTRANSITION, TRANSITION_BODY_MORPH, TRANSITION_BODY_RESIZE, TRANSITION_BORDER_RESIZE, TRANSITION_DOWN, TRANSITION_UPFields inherited from interface overit.geocall.ui.DAViewManager
PAGE_FIRST, PAGE_LAST, PAGE_NEXT, PAGE_PREVIOUS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidchanged(overit.geocall.ux.servlet.processor.Change change) Defines the morphing of the table element that occurs when there is an Ajax interaction
Implements theAjaxableComponentinterface.protected DBViewfetchRange(int maxrows, int skiprows) getDa()Returns the DA used to fetch the recordsgetDAO()Returns the DAO used to fetch the recordsgetDAO0()Deprecated.protected Stringprotected org.apache.ecs.ElementgetExtensionRow(int end) org.apache.ecs.ElementgetFrameHtml(overit.geocall.ux.servlet.processor.Change change, EntitySet es) Defines the html part of the table that changes when an Ajax interaction occurs.getMode()Returns the current active mode of the table (seesetMode(mode))protected org.apache.ecs.ElementReturns theHashGetterthat contains the values that will be associated to the parameters of the query used to fetch the records of the table (seeDABase)intReturns the id of the query used to fetch the records of the table (seeDABase)booleaninMemory()voidload(int page) Loads the records of the specific page of the table.protected voidload(int page, boolean extension) protected booleanneedsNavBar(int pages) booleanDeselects all the rows of the current page of the tablebooleanLoads and displays some more rows of the table.booleanonFirstPage(Object obj) Loads the first page of the table.booleanonLastPage(Object obj) Loads the last page of the table.protected voidonNewDBView(DBView dbv) booleanonNextPage(Object obj) Loads the next page of the table.booleanonPreviousPage(Object obj) Loads the previous page of the table.booleanSelects all the rows of the current page of the tableprotected org.apache.ecs.ElementpageExtension(EntitySet es, int n, int pages) voidSets the DADABaseused to do the queries that fetches the data from the databasevoidSets the DADABaseused to do the queries that fetches the data from the databasevoidSets the DAODAOused to do the queries that fetches the data from the databasevoidSets the DAODAOused to do the queries that fetches the data from the databasevoidvoidvoidSets theDBView, i.e. the logical view of a portion of a database table usually obtained as a result of a query, to the ServerTableView.voidWhen used, it will appear a button at the bottom of the table, used to load more rows.voidMakes visible the "go to the last page" button when the pagination is active on the table.voidsetMAXROWS(String s) Sets the maximum number of records to fetch from the database.voidDefines the mode of the table.voidsetParams(HashGetter params) Sets theHashGetterthat contains the values that will be associated to the parameters of the query used to fetch the records of the table (seeDABase)voidSets the string that defines the name of the query that will be used to fetch the data from the database.voidvoidsetQueryId(int id) Sets the id of the query used to fetch the records of the table (seeDABase)voidSets the number of the rows of the table to be displayed.protected intprotected voidupdateCurrentRowsForPage(int newRows) Methods inherited from class overit.geocall.basic.ui.container.TableView
addPageSizeLookup, buildDisplayScript, buildScrollScript, buildScrollTopScript, buildSetupScript, buildStuckScript, canPaste, changedMetaData, chooseSelectAction, clickOnControlLightMenu, clickOnControlMenu, collectEntities, doCopy, doCut, doPaste, doRemove, drag, dragDrop, dragged, drop, findColumnGroup, freeClip, getCaption, getColumnByLayoutName, getColumnByName, getColumns, getCurrentPage, getCUTNAME, getCutSet, getCutting, getCuttingSize, getDBView, getDefaultChange, getDropDownMenu, getEntities, getEntityValidator, getFieldsProfileVisibilityList, getFieldsUserVisibilityList, getFOOTERLASTROW, getHtml, getNavBarHtml, getOriginalColumns, getPage, getProfileLayoutCustomizations, getProfileStateConf, getProfileStateConfFields, getRo, getRows, getRows, getSelection, getSelectionSize, getSELECTNAME, getSelectSet, getStateConf, getStateConfAttributes, getStateConfFields, getTitle, getTR, getUserComponentAttributesMap, getUserLayoutCustomizations, getXmlColumns, hasTableOrders, invalidateComponentsAttributeMap, isCutSet, isCutted, isSelected, isSelectSet, isVisible, moveColumn, onAutoSelect, onBodyClick, onChangeRows, onColumnMove, onControlLightMenu, onControlMenu, onCopy, onCopy, onCut, onCut, onOpen, onOpenPage, onOrder, onPaste, onPaste, onRemove, onRemove, onSaveLightTableCustomization, onSelect, onSelect, onSelectAll, onSelectNone, onSelectTable, onSingleSelect, onSingleSelect, onTableOrdersMenu, onToggle, pasteContent, selectAction, setANCHOR, setBKGCOLORNAME, setBKGCOLORSWITCH, setCONTENTFRAME, setCUTNAME, setDRAGGABLE, setDROPPABLE, setEDITABLE, setENTITY, setEVENT, setEVENT2, setEVENTMODE, setEVENTR, setFOOTERLASTROW, setFooterValues, setFROM, setFULLSIZE, setHEIGHT, setMINWIDTH, setMODE, setMsg, setMSG, setMsg2, setMSG2, setMsgR, setMSGR, setPARAM, setPARAM2, setPARAMR, setRo, setSELECTNAME, setSelectSet, setSELECTSET, setTITLEFORMAT, setTO, setup, setupMetaData, setupSelection, setupTableColumns, setupUserHiddenColumns, setVISIBLE, setXCLASS, stuckColumnsEnabled, updateStateConf, userIsAllowedToEditTablesMethods inherited from class overit.geocall.basic.ui.Container
alert, applyRule, getBASIC, getBLANK, getRO, getROField, onClose, onOpenChildContainer, onRestore, onRule, prepareName, rulesNewValues, setROField, setValues, setValuesMethods inherited from class overit.geocall.ui.Control
avoidNull, clean, getBadgeFormat, getBadgeValue, getCleaner, getConfigurableProperties, getDAValues, getDBLINK, getKEYLABEL, getLABEL, getState, getTITLE, getValues, getWM, isEnabled, isEnabledBasedOnFunction, isFunctionEnabled, isImportant, isRoBasedOnFunction, nameWithNoFilterPrefix, setALTEVENTICON, setALTICON, setARIADESCRIPTION, setARIALABEL, setBADGEFORMAT, setBADGEVALUE, setBLANK, setCLEANER, setConfiguredProperty, setDBLINK, setENABLED, setFUNCTION, setModelProperties, setRO, setTitle, setTITLEMethods inherited from class overit.geocall.ui.Component
adapt, ajaxQuery, appendAttribute, calcKeyLabel, calcLabel, calcShortcut, canBeConfigured, changed, clearConfiguredProperties, componentIterator, componentSize, connect, containerIterator, createAjaxFrame, deprecate, fillSetupScript, generateFlexableFullHeightContainer, generateId, getBoolean, getBoolean, getChildrenComponents, getChildrenContainers, getDefaultLabel, getDefaultLayoutLabel, getEntityContainer, getEntityName, getFullHeight, getGridAlign, getGridCols, getGridRows, getGridVAlign, getHtmlLabel, getHtmlLabel, getIcon, getId, getIdentity, getint, getLayoutLabel, getLayoutName, getNAME, getParentComponent, getParentContainer, getPublishedChildrenList, getRegistryName, getSHORTCUT, getTabIndex, getTeacher, getValuesContainer, getWindow, initChilds, isActivable, isActive, isAliasField, isConfigHidden, isDefaultHidden, isExtendedField, isLabelInLine, onInit, setActivable, setActive, setAliasField, setBASIC, setConfigHidden, setDEFAULTHIDDEN, setEntityName, setExtendedField, setFULLHEIGHT, setGRIDALIGN, setGRIDCOLS, setGRIDROWS, setGRIDVALIGN, setICON, setIdentity, setIMPORTANT, setLabel, setLABEL, setLABELINLINE, setLAYOUTLABEL, setLAYOUTNAME, setNAME, setREGISTRYNAME, setTooltip, setValuesContainer, stringForJs, tabIndexerMethods inherited from class overit.geocall.platform.ui.UINode
addChild, addChildText, getChildren, getNodeId, getParent, getRoot, getSchema, setNodeId, setParent, setSchemaMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface overit.geocall.ui.Badgeable
badgeFormat, makeBadgedIconMethods inherited from interface overit.geocall.ui.DBViewManager
changedMetaData, getDBView, getRo, setFROM, setRo, setTOMethods inherited from interface overit.geocall.ui.Hideable
getVISIBLEMethods inherited from interface overit.geocall.clipboard.XClip
getWM
-
Field Details
-
_da
-
_dao
-
_dao0
-
_queryid
protected int _queryid -
_queryCommand
-
_params
-
_orderFields
-
_queryExecuted
protected boolean _queryExecuted -
_lastButton
protected boolean _lastButton -
_maxrows
protected int _maxrows -
_initRows
protected int _initRows -
_extension
protected int _extension -
haveMore
protected boolean haveMore
-
-
Constructor Details
-
ServerTableView
public ServerTableView()
-
-
Method Details
-
inMemory
public boolean inMemory()to inspect if the ServerTableView works in-memory by setting aDBViewor if it is feeded byDAO,DAO0orDABase- Returns:
- true if the ServerTableView works in memory by setting a
DBView, false otherwise
-
setLASTBUTTON
Makes visible the "go to the last page" button when the pagination is active on the table.
Clicking on the button, the table will display the very last records of the table with the side effect to load the whole data set. This can be dangerous if the number of the records is very large, and can saturate the memory- Parameters:
s- true if the "go to last page" must be shown, false otherwise.
-
setMAXROWS
Sets the maximum number of records to fetch from the database.- Parameters:
s- Maximum number of rows, if 0 no limit will be applied
-
setEXTENSION
When used, it will appear a button at the bottom of the table, used to load more rows.
The number of rows loaded on every click is the number passed as parameter.- Parameters:
s- Number of rows to be loaded via the button
-
setROWS
Sets the number of the rows of the table to be displayed.
If the total number of rows in the table is greater than the number of rows set by this method, the table will be paginated and will appear the arrows with the possibility to browse through the pages. -
getExtensionRow
protected org.apache.ecs.Element getExtensionRow(int end) - Overrides:
getExtensionRowin classTableView
-
getExtensionLabel
-
setDA
Sets the DADABaseused to do the queries that fetches the data from the database- Parameters:
o- The DA used by the table
-
setDAO
Sets the DAODAOused to do the queries that fetches the data from the database- Parameters:
o- The DAO used by the table
-
setDAO0
Deprecated.- Parameters:
o- The DAO used by the table
-
setQUERY
Sets the string that defines the name of the query that will be used to fetch the data from the database.- Parameters:
query- The query used by the table. Pay attention to match with one of the constant's names defined in theDABaseset by the methodsetDA(obj)orsetDA(da)
-
onNextPage
Loads the next page of the table. Called when the user click on the "go to next page" button of the navigation bar of the table.- Parameters:
obj- Not used- Returns:
true
-
onPreviousPage
Loads the previous page of the table. Called when the user click on the "go to previous page" button of the navigation bar of the table.- Parameters:
obj- Not used- Returns:
true
-
onFirstPage
Loads the first page of the table. Called when the user click on the "go to first page" button of the navigation bar of the table.- Parameters:
obj- Not used- Returns:
true
-
onLastPage
Loads the last page of the table. Called when the user click on the "go to last page" button (if present, seesetLASTBUTTON(java.lang.String)) of the navigation bar of the table.- Parameters:
obj- Not used- Returns:
true
-
onExtends
Loads and displays some more rows of the table. The number of new rows loaded depends on the attributeextension, settet withsetEXTENSION(java.lang.String). It's the method called when the user click on the button that appears on the bottom of the table- Parameters:
uim- Not used- Returns:
true
-
setupRanges
protected int setupRanges() -
updateCurrentRowsForPage
protected void updateCurrentRowsForPage(int newRows) - Overrides:
updateCurrentRowsForPagein classTableView
-
changed
public void changed(overit.geocall.ux.servlet.processor.Change change) Defines the morphing of the table element that occurs when there is an Ajax interaction
Implements theAjaxableComponentinterface.- Specified by:
changedin interfaceAjaxableComponent- Overrides:
changedin classTableView- Parameters:
change- TheChangeobject that defines the specific morphing type for the table
-
getFrameHtml
public org.apache.ecs.Element getFrameHtml(overit.geocall.ux.servlet.processor.Change change, EntitySet es) Defines the html part of the table that changes when an Ajax interaction occurs.
Implements theAjaxableComponentinterface.- Specified by:
getFrameHtmlin interfaceAjaxableComponent- Overrides:
getFrameHtmlin classTableView- Parameters:
change- TheChangeobject that defines the specific morphing type for the tablees- TheEntitySetto which the element belongs- Returns:
- The html part of the table that changes when an Ajax interaction occurs
-
pageExtension
-
setDBView
Sets theDBView, i.e. the logical view of a portion of a database table usually obtained as a result of a query, to the ServerTableView.
Implements theDBViewManagerinterface.- Specified by:
setDBViewin interfaceDBViewManager- Overrides:
setDBViewin classTableView- Parameters:
dbv- The DBView that we want to set to the table
-
getDa
Returns the DA used to fetch the records- Specified by:
getDain interfaceDAViewManager- Returns:
- The DA associated to the table
-
getDAO
Returns the DAO used to fetch the records- Returns:
- The DAO associated to the table
-
getDAO0
Deprecated.useDAOinstead Returns the DAO0 used to fetch the records- Returns:
- The DAO0 associated to the table
-
getParams
Returns theHashGetterthat contains the values that will be associated to the parameters of the query used to fetch the records of the table (seeDABase)- Specified by:
getParamsin interfaceDAViewManager- Returns:
- The HashGetter of the parameters used for the query
-
getQueryId
public int getQueryId()Returns the id of the query used to fetch the records of the table (seeDABase)- Specified by:
getQueryIdin interfaceDAViewManager- Returns:
- The id of the query
-
setDa
Sets the DADABaseused to do the queries that fetches the data from the database- Specified by:
setDain interfaceDAViewManager- Parameters:
da- The DA used by the table
-
setDao
Sets the DAODAOused to do the queries that fetches the data from the database- Parameters:
dao- The DAO used by the table
-
setDao0
Deprecated.- Parameters:
dao0- The DAO0 used by the table
-
setParams
Sets theHashGetterthat contains the values that will be associated to the parameters of the query used to fetch the records of the table (seeDABase)- Specified by:
setParamsin interfaceDAViewManager- Parameters:
params- The HashGetter of the parameters used for the query
-
setQueryId
public void setQueryId(int id) Sets the id of the query used to fetch the records of the table (seeDABase)- Specified by:
setQueryIdin interfaceDAViewManager- Parameters:
id- The id of the query
-
setQueryCommand
- Parameters:
c- The Command that will be execute in order to retrieve the records from the database.
-
onNewDBView
-
load
public void load(int page) Loads the records of the specific page of the table. It's the method that makes the queries.- Parameters:
page- The number of the page to be loaded
-
fetchRange
-
load
protected void load(int page, boolean extension) -
getMode
Returns the current active mode of the table (seesetMode(mode))- Specified by:
getModein interfaceDBViewManager- Overrides:
getModein classTableView- Returns:
- The string that defines the current active mode of the table
-
setMode
Defines the mode of the table. It is possible to indicate the name of the query used to fetch the records, or the name of the field used to sort all the records in ascending or descending order (seeTableView.setMode(java.lang.String)); it is possible to define both, using the # character to divide the name of the query from the names of the fields used for the sorting- Specified by:
setModein interfaceDBViewManager- Overrides:
setModein classTableView- Parameters:
mode- The name of the query used to fetch the records, or the name of the field(s) used for sorting.
-
onSelectCurrPage
Selects all the rows of the current page of the table- Parameters:
o- Not used- Returns:
false
-
onDeSelectCurrPage
Deselects all the rows of the current page of the table- Parameters:
o- Not used- Returns:
false
-
buildLoadPageScript
- Overrides:
buildLoadPageScriptin classTableView
-
DAOinstead Returns the DAO0 used to fetch the records