public class SelectWidget extends MeshWidget
Modifier and Type | Field and Description |
---|---|
boolean |
rightSelect
Whether to change a list item selection on right click
Default: true (unless the server changes the setting)
|
$weave, auDelay, autag, bindLevel, className, desktop, effects_, firstChild, id, insertingBefore_, inServer, lastChild, nChildren, nextSibling, parent, previousSibling, uuid, widgetName
Modifier and Type | Method and Description |
---|---|
void |
clearSelection()
Clears the selection.
|
void |
fireOnSelect(Widget ref)
Fires the onSelect event.
|
protected void |
fixAnchor_(int[] offs)
May need fix anchor.
|
String |
getName()
Returns the name of this component.
|
int |
getSelectedIndex()
Returns the index of the selected item (-1 if no one is selected).
|
ItemWidget |
getSelectedItem()
Returns the selected item.
|
Array |
getSelectedItems()
Returns all selected items.
|
int |
indexOfItem(ItemWidget item)
Returns the index of the ItemWidget
|
boolean |
isCheckmark()
Returns whether the check mark shall be displayed in front of each item.
|
boolean |
isMultiple()
Returns whether multiple selections are allowed.
|
void |
selectAll(boolean notify,
Event evt)
Selects all items.
|
void |
selectItem(ItemWidget item)
Deselects all of the currently selected items and selects the given item.
|
void |
setCheckmark(boolean checkmark)
Sets whether the check mark shall be displayed in front of each item.
|
void |
setMultiple(boolean multiple)
Sets whether multiple selections are allowed.
|
void |
setName(String name)
Sets the name of this component.
|
void |
setSelectAll(boolean notify,
Event evt)
Selects all items.
|
void |
setSelectedIndex(int selectedIndex)
Deselects all of the currently selected items and selects the item with
the given index.
|
void |
setSelectedItem(ItemWidget item)
Deselects all of the currently selected items and selects the given item.
|
protected int |
shallIgnoreSelect_(Event evt,
ItemWidget row)
Returns whether to ignore the selection.
|
calcSize, getActivePage, getFocusCell, getHeadWidget, getInnerWidth, getPageCount, getPageSize, getPaginal, getPagingPosition, getRows, getSpan, inPagingMold, isAutopaging, isModel, isSizedByContent, scrollToIndex, setActivePage, setAutopaging, setInnerWidth, setModel, setPageSize, setPaginal, setPagingPosition, setRows, setSizedByContent, setSpan, syncSize
afterKeyDown_, beforeCtrlKeys_, getContext, getCtrlKeys, getOpenTooltip, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
$, $f, $f, $f, $init, $n, $n, $o, $s, $service, afterAnima_, afterParentChanged_, appendChild, appendChild, beforeParentChanged_, beforeSendAU_, bind_, bind, bindChildren_, bindDoubleTap_, bindMissingAncestors, bindSwipe_, bindTapHold_, canActivate, cleanDrag_, clear, clearCache, cloneDrag_, deferRedraw_, deferRedrawHTML_, detach, doBlur_, doClick_, doDoubleClick_, doFocus_, doKeyDown_, doKeyPress_, doKeyUp_, domAttrs_, domClass_, domListen_, doMouseDown_, doMouseMove_, doMouseOut_, doMouseOver_, doMouseUp_, domStyle_, domTextStyleAttr_, domTooltiptext_, domUnlisten_, doPaste_, doResizeScroll_, doRightClick_, doSelect_, doSwipe_, doTooltipOut_, doTooltipOver_, dropEffect_, extraBind_, fire, fireX, focus_, focus, forcerender, fromPageCoord, get, getAction, getCaveNode, getChildAt, getChildIndex, getClass, getCssflex, getDraggable, getDragMessage_, getDragNode, getDragOptions_, getDrop_, getDroppable, getElementsById, getElementsByName, getFirstNode_, getFloatZIndex_, getHeight, getHflex, getId, getLeft, getMold, getOldWidget_, getPage, getRenderdefer, getSclass, getScrollLeft, getScrollTop, getStyle, getTabindex, getTextNode, getTooltiptext, getTop, getTopWidget, getVflex, getWidth, getZclass, getZIndex, hide, ignoreDescendantFloatUp_, ignoreDrag_, initDrag_, insertBefore, insertChildHTML_, isAutoId, isBinding, isFloating_, isListen, isRealElement, isRealVisible, isRealVisible, isVisible, isVisible, isWatchable_, listen, listenOnFitSize_, mimicMouseDown_, newInstance, nextUuid, onAfterSize, onChildAdded_, onChildRemoved_, onChildRenderDefer_, onChildReplaced_, onChildVisible_, onDrop_, redraw, redrawHTML_, register, removeChild, removeChild, removeChildHTML_, removeHTML_, replaceCavedChildren_, replaceChildHTML_, replaceHTML, replaceWidget, rerender, rerender, rerenderLater_, rerenderNow_, scrollIntoView, sendAU_, set, set, setAction, setChildren, setCssflex, setDomVisible_, setDraggable, setDroppable, setFloating_, setFloatZIndex_, setHeight, setHflex, setId, setLeft, setListener, setListener, setListeners, setMold, setRenderdefer, setSclass, setScrollLeft, setScrollTop, setStyle, setTabindex, setTooltiptext, setTop, setTopmost, setVflex, setVisible, setWidth, setZclass, setZIndex, shallChildROD_, shallFireSizedLaterWhenAddChd_, shallIgnoreClick_, show, smartUpdate, unbind_, unbind, unbindChildren_, unbindDoubleTap_, unbindSwipe_, unbindTapHold_, uncloneDrag_, unlisten, unlistenOnFitSize_, updateDomClass_, updateDomStyle_, uuid, zsync
$init, $instanceof, $super, $super, $supers, $supers, afterInit, isAssignableFrom, isInstance, proxy
public boolean rightSelect
Default: true (unless the server changes the setting)
public void setCheckmark(boolean checkmark)
The check mark is a checkbox if isMultiple()
returns true. It is a
radio button if isMultiple()
returns false.
checkmark
- public boolean isCheckmark()
Default: false.
public void setMultiple(boolean multiple)
multiple
- public boolean isMultiple()
Default: false.
public void setSelectedIndex(int selectedIndex)
selectedIndex
- public int getSelectedIndex()
public void setName(String name)
The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers. It doesn't work with other kind of clients.
Don't use this method if your application is purely based on ZK's event-driven model.
name
- the name of this component.public String getName()
Default: null.
The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers. It doesn't work with other kind of clients.
Don't use this method if your application is purely based on ZK's event-driven model.
public void setSelectedItem(ItemWidget item)
It is the same as selectItem(zul.sel.ItemWidget)
.
item
- public ItemWidget getSelectedItem()
public Array getSelectedItems()
public int indexOfItem(ItemWidget item)
item
- public void selectItem(ItemWidget item)
It is the same as setSelectedItem(zul.sel.ItemWidget)
.
item
- the item to select. If null, all items are deselected.public void clearSelection()
protected int shallIgnoreSelect_(Event evt, ItemWidget row)
Widget.doSelect_(zk.Event)
).
Default: always false (don't ignore) unless rightSelect
is true and event is onRightClick.
Notice that clicking on button/textbox are already ignored, i.e.,
this method won't be called if the user clicks on, say, a button.
evt
- the eventrow
- the row about to be selectedprotected void fixAnchor_(int[] offs)
offs
- The anchor offset [left, top]public void fireOnSelect(Widget ref)
ref
- the reference which causes this onSelect event.
Ignored if null.public void setSelectAll(boolean notify, Event evt)
notify
- if true, fire onSelect event to serverevt
- public void selectAll(boolean notify, Event evt)
notify
- if true, fire onSelect event to serverevt
- Copyright © 2005-2023 Potix Corporation. All Rights Reserved.