Class CardView
- 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:
CardViewWfm,CVMaterials
The class extends
To use it, it is necessary to add a <![CDATA[]]> element directly as a child of CardView, as shown in the following example:
Alternatively it's possible to extend this class, implementing the
ServerTableView and implements the user interface objects that allows to show the records as cards.
It is a responsive component which can adapts and reorganizes the cards accordingly to the available space of the page. To use it, it is necessary to add a <![CDATA[]]> element directly as a child of CardView, as shown in the following example:
<CardView>
<![CDATA[
<div>This is a format for a card {NAME}</div>
]]>
</CardView>
as you can see, the content of CDATA is a format, and so it's possible to use variables and the other features exposed by the
MapFormat class.Alternatively it's possible to extend this class, implementing the
getCardHtml() method, which will contain the logic
that generates the html code necessary to render the contents of each card.- 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 StringBuilderprotected intprotected intprotected intFields inherited from class overit.geocall.basic.ui.container.ServerTableView
_da, _dao, _dao0, _extension, _initRows, _lastButton, _maxrows, _orderFields, _params, _queryCommand, _queryExecuted, _queryid, haveMoreFields 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 TypeMethodDescriptionvoidaddChildText(String text) Empty methodprotected voidaddJavascriptClickEvents(org.apache.ecs.html.Div card, int index, StringBuilder cardClass) protected voidaddJavascriptDDEvents(org.apache.ecs.html.Div item, int index) protected voidaddJavascriptDesktopClickEvents(int index, Ref<String> onclick, Ref<String> ondbclick, Ref<String> oncontextmenu, Ref<Boolean> roll) protected voidaddJavascriptMobileClickEvents(int index, Ref<String> onclick, Ref<String> ontouchstart, Ref<String> ontouchend, Ref<String> ontouchmove, Ref<String> ontouchcancel) voidEvery component can add a script to the StringBuilder, script executed when the component is displayed The method add the script that manage the position of the scrollbar of the CardViewvoidEvery component can add a script to the StringBuilder, script executed when the component is created The method add the script that manage the creation of the cardsvoidchanged(overit.geocall.ux.servlet.processor.Change c) Defines the morphing of the table element that occurs when there is an Ajax interaction
Implements theAjaxableComponentinterface.protected voidchangedCard(int index) protected booleanprotected org.apache.ecs.ConcreteElementprotected org.apache.ecs.ElementgetCardHtml(EntitySet es, int index, HashGetter params) This method uses the html defined intoCDATAchild to render the content of the cards.protected List<org.apache.ecs.Element> protected org.apache.ecs.ElementgetCardView(EntitySet es) overit.geocall.ux.servlet.processor.ChangeDefines the defaultChangeobject for the table.org.apache.ecs.ElementgetFrameHtml(overit.geocall.ux.servlet.processor.Change c, EntitySet es) It defines the html part of the CardView that changes when an Ajax interaction occurs.booleanonControlMenu(UIMessage uim) Fired when the user click on the icon in the upper left corner of the CardView.voidSets the number of cards to display for every page (the method activate the pagination mode of the CardView).voidSets the width of every card.voidSets number of (cards) columns for every row.voidSets the height of the CardView.voidEmpty method used to inhibit the use of ServerTableView's setRows(String s) method, usesetCARDS(String)protected booleanMethods inherited from class overit.geocall.basic.ui.container.ServerTableView
buildLoadPageScript, fetchRange, getDa, getDAO, getDAO0, getExtensionLabel, getExtensionRow, getMode, getNavBar, getParams, getQueryId, inMemory, load, load, needsNavBar, onDeSelectCurrPage, onExtends, onFirstPage, onLastPage, onNewDBView, onNextPage, onPreviousPage, onSelectCurrPage, pageExtension, setDa, setDA, setDao, setDAO, setDao0, setDAO0, setDBView, setEXTENSION, setLASTBUTTON, setMAXROWS, setMode, setParams, setQUERY, setQueryCommand, setQueryId, setupRanges, updateCurrentRowsForPageMethods inherited from class overit.geocall.basic.ui.container.TableView
addPageSizeLookup, buildScrollScript, buildScrollTopScript, buildStuckScript, canPaste, changedMetaData, chooseSelectAction, clickOnControlLightMenu, collectEntities, doCopy, doCut, doPaste, doRemove, drag, dragDrop, dragged, drop, findColumnGroup, freeClip, getCaption, getColumnByLayoutName, getColumnByName, getColumns, getCurrentPage, getCUTNAME, getCutSet, getCutting, getCuttingSize, getDBView, 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, 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, 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, updateStateConfMethods 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, 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
-
_reloadCard
protected int _reloadCard -
_cardWidth
protected int _cardWidth -
_cols
protected int _cols -
_cardFormat
-
-
Constructor Details
-
CardView
public CardView()
-
-
Method Details
-
setROWS
Empty method used to inhibit the use of ServerTableView's setRows(String s) method, usesetCARDS(String)- Overrides:
setROWSin classServerTableView- Parameters:
s- Empty method, usesetCARDS(String)
-
setCARDS
Sets the number of cards to display for every page (the method activate the pagination mode of the CardView). If no value is specified for theextensionattribute (ServerTableView.setEXTENSION(String)), the following pages will contain a number of cards equal to the value indicated with this method- Parameters:
s- The number of cards displayed for every page
-
setHEIGHT
Sets the height of the CardView. -
setCARDWIDTH
Sets the width of every card. This is useful to constraint the card size; if not specified, every card will fit horizontally- Parameters:
s- The width of the single card, expressed in pixel
-
setCOLS
Sets number of (cards) columns for every row. If not specified the container try to insert as much card as possible in a single row.- Parameters:
s- The number of cards for every row
-
addChildText
Description copied from class:UINodeEmpty method- Overrides:
addChildTextin classUINode- Parameters:
text- Not used
-
buildSetupScript
Every component can add a script to the StringBuilder, script executed when the component is created The method add the script that manage the creation of the cards- Overrides:
buildSetupScriptin classTableView- Parameters:
sb- The StringBuilder on which we want to add the script
-
buildDisplayScript
Every component can add a script to the StringBuilder, script executed when the component is displayed The method add the script that manage the position of the scrollbar of the CardView- Overrides:
buildDisplayScriptin classTableView- Parameters:
sb- The StringBuilder on which we want to add the script
-
getFrameHtml
public org.apache.ecs.Element getFrameHtml(overit.geocall.ux.servlet.processor.Change c, EntitySet es) It defines the html part of the CardView that changes when an Ajax interaction occurs.
Implements theAjaxableComponentinterface.- Specified by:
getFrameHtmlin interfaceAjaxableComponent- Overrides:
getFrameHtmlin classServerTableView- Parameters:
c- TheChangeobject that defines the specific morphing type for the CardViewes- TheEntitySetto which the element belongs- Returns:
- The html part of the CardView that changes when an Ajax interaction occurs
-
getCardView
- Parameters:
es- TheEntitySetto which the element belongs- Returns:
- the html structure containing all the cards
-
getCards
- Parameters:
es- TheEntitySetto which the element belongsfrom- start page indexto- end page index- Returns:
- the list containing the html elements representing the cards contained within a page's range.
-
getCard
- Parameters:
es- TheEntitySetto which the element belongsindex- card's position- Returns:
- the html element of the card at the given index.
-
addJavascriptDDEvents
protected void addJavascriptDDEvents(org.apache.ecs.html.Div item, int index) -
addJavascriptClickEvents
protected void addJavascriptClickEvents(org.apache.ecs.html.Div card, int index, StringBuilder cardClass) -
addJavascriptMobileClickEvents
-
addJavascriptDesktopClickEvents
-
getCardHtml
This method uses the html defined intoCDATAchild to render the content of the cards. If you haven't defined anyCDATAchild, or you want to generate a much more custom template, override this method with the logic that generates the html code necessary to render the content of a card- Parameters:
es- TheEntitySetto which the element belongsindex- The index of the cardparams- The map of the row rendered as a card- Returns:
- The html code of a single card
-
changed
public void changed(overit.geocall.ux.servlet.processor.Change c) Description copied from class:ServerTableViewDefines the morphing of the table element that occurs when there is an Ajax interaction
Implements theAjaxableComponentinterface.- Specified by:
changedin interfaceAjaxableComponent- Overrides:
changedin classServerTableView- Parameters:
c- TheChangeobject that defines the specific morphing type for the table
-
getDefaultChange
public overit.geocall.ux.servlet.processor.Change getDefaultChange()Description copied from class:TableView- Specified by:
getDefaultChangein interfaceAjaxableComponent- Overrides:
getDefaultChangein classTableView- Returns:
- The default
Changeobject that defines the default morphing type of the table
-
changedCard
protected void changedCard(int index) -
clickOnControlMenu
protected boolean clickOnControlMenu()- Overrides:
clickOnControlMenuin classTableView
-
userIsAllowedToEditTables
protected boolean userIsAllowedToEditTables()- Overrides:
userIsAllowedToEditTablesin classTableView
-
onControlMenu
Fired when the user click on the icon in the upper left corner of the CardView. Override the method to program the desired logic (like for example the expansion / contraction of all the cards)- Overrides:
onControlMenuin classTableView- Parameters:
uim- Not Used- Returns:
false
-