public class Widget extends Widget
The corresponding Java class is org.zkoss.zul.impl.XulElement.
If a widget has a client attribute 'scrollable', it will listen onScroll
event.
$weave, auDelay, autag, bindLevel, className, desktop, effects_, firstChild, id, insertingBefore_, inServer, lastChild, nChildren, nextSibling, parent, previousSibling, uuid, widgetName
Modifier and Type | Method and Description |
---|---|
protected boolean |
afterKeyDown_(Event evt,
boolean simulated)
Called after
Widget.doKeyDown_(zk.Event) is called and the event
propagation is not stopped. |
protected boolean |
beforeCtrlKeys_(Event evt)
Called before a control key is pressed.
|
String |
getContext()
Returns the ID of the popup (
Popup ) that should appear
when the user right-clicks on the element (aka., context menu). |
String |
getCtrlKeys()
Returns what keystrokes to intercept.
|
static Widget |
getOpenTooltip()
Returns the tooltip that is opened, or null if no tooltip is opened.
|
String |
getPopup()
Returns the ID of the popup (
Popup ) that should appear
when the user clicks on the element. |
String |
getTooltip()
Returns the ID of the popup (
Popup ) that should be used
as a tooltip window when the mouse hovers over the element for a moment. |
Widget |
setContext(Popup context)
Sets the ID of the popup (
Popup ) that should appear
when the user right-clicks on the element (aka., context menu). |
void |
setContext(String context)
Sets the ID of the popup (
Popup ) that should appear
when the user right-clicks on the element (aka., context menu). |
Widget |
setCtrlKeys(String keys)
Sets what keystrokes to intercept.
|
Widget |
setPopup(Popup popup)
Sets the ID of the popup (
Popup ) that should appear
when the user clicks on the element. |
void |
setPopup(String popup)
Sets the ID of the popup (
Popup ) that should appear
when the user clicks on the element. |
Widget |
setTooltip(Popup popup)
Sets the ID of the popup (
Popup ) that should be used
as a tooltip window when the mouse hovers over the element for a moment. |
void |
setTooltip(String tooltip)
Sets the ID of the popup (
Popup ) that should be used
as a tooltip window when the mouse hovers over the element for a moment. |
$, $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 String getContext()
Popup
) that should appear
when the user right-clicks on the element (aka., context menu).
Default: null (no context menu).
public Widget setContext(Popup context)
Popup
) that should appear
when the user right-clicks on the element (aka., context menu).
An onOpen event is sent to the context menu if it is going to appear. Therefore, developers can manipulate it dynamically (perhaps based on OpenEvent.getReference) by listening to the onOpen event.
Note: To simplify the use, it not only searches its ID space, but also all ID spaces in the desktop. It first searches its own ID space, and then the other Id spaces in the same browser window (might have one or multiple desktops).
If there are two components with the same ID (of course, in
different ID spaces), you can specify the UUID with the following
format:
uuid(comp_uuid)
Example:
wgt.setContext('an_id');
wgt.setContext('uuid(an_uuid)');
wgt.setContext(a_wgt);
Both reference a component whose ID is "some".
But, if there are several components with the same ID,
the first one can reference to any of them.
And, the second one reference to the component in the same ID space
(of the label component).
The context menu can be shown by a position from
Popup.open(zk.Widget, Offset, String, Map)
or the location of x
and y
, you can specify the following format:
id, position
id, position=before_start
id, x=15, y=20
uuid(comp_uuid), position
uuid(comp_uuid), x=15, y=20
wgt.setContext('an_id', 'start_before');Since 6.5.2, the context menu can also be shown on customized location of
x
and y
by adding parentheses"()", for example,
wgt.setContext('an_id', 'x=(zk.currentPointer[0] + 10), y=(zk.currentPointer[1] - 10)');
context
- the popup widget.public void setContext(String context)
Popup
) that should appear
when the user right-clicks on the element (aka., context menu).context
- the ID of the popup widget.setContext(zul.wgt.Popup)
public String getPopup()
Popup
) that should appear
when the user clicks on the element.
Default: null (no popup).
public Widget setPopup(Popup popup)
Popup
) that should appear
when the user clicks on the element.
An onOpen event is sent to the popup menu if it is going to appear. Therefore, developers can manipulate it dynamically (perhaps based on OpenEvent.getReference) by listening to the onOpen event.
Note: To simplify the use, it not only searches its ID space, but also all ID spaces in the desktop. It first searches its own ID space, and then the other Id spaces in the same browser window (might have one or multiple desktops).
If there are two components with the same ID (of course, in
different ID spaces), you can specify the UUID with the following
format:
uuid(comp_uuid)
Example:
wgt.setPopup('an_id');
wgt.setPopup('uuid(an_uuid)');
wgt.setPopup(a_wgt);
Both reference a component whose ID is "some".
But, if there are several components with the same ID,
the first one can reference to any of them.
And, the second one reference to the component in the same ID space
(of the label component).
The popup menu can be shown by a position from
Popup.open(zk.Widget, Offset, String, Map)
or the location of x
and y
, you can specify the following format:
id, position
id, position=before_start
id, x=15, y=20
uuid(comp_uuid), position
uuid(comp_uuid), x=15, y=20
wgt.setPopup('an_id', 'start_before');Since 6.5.2, the popup can also be shown on customized location of
x
and y
by adding parentheses"()", for example,
wgt.setPopup('an_id', 'x=(zk.currentPointer[0] + 10), y=(zk.currentPointer[1] - 10)');
popup
- the popup widget.public void setPopup(String popup)
Popup
) that should appear
when the user clicks on the element.popup
- the ID of the popup widget.setPopup(zul.wgt.Popup)
public String getTooltip()
Popup
) that should be used
as a tooltip window when the mouse hovers over the element for a moment.
The tooltip will automatically disappear when the mouse is moved away.
Default: null (no tooltip).
public Widget setTooltip(Popup popup)
Popup
) that should be used
as a tooltip window when the mouse hovers over the element for a moment.
An onOpen event is sent to the tooltip if it is going to appear. Therefore, developers can manipulate it dynamically (perhaps based on OpenEvent.getReference) by listening to the onOpen event.
Note: To simplify the use, it not only searches its ID space, but also all ID spaces in the desktop. It first searches its own ID space, and then the other Id spaces in the same browser window (might have one or multiple desktops).
If there are two components with the same ID (of course, in
different ID spaces), you can specify the UUID with the following
format:
uuid(comp_uuid)
Example:
wgt.setTooltip('an_id');
wgt.setTooltip('uuid(an_uuid)');
wgt.setTooltip(a_wgt);
Both reference a component whose ID is "some".
But, if there are several components with the same ID,
the first one can reference to any of them.
And, the second one reference to the component in the same ID space
(of the label component).
The tooltip can be shown by a position from
Popup.open(zk.Widget, Offset, String, Map)
or the location of x
and y
, and can be specified
with a delay time (in millisecond), you can specify the following format:
id, position
id, position=before_start, delay=500
id, x=15, y=20
uuid(comp_uuid), position
uuid(comp_uuid), x=15, y=20
wgt.setTooltip('an_id', 'start_before');Since 6.5.2, the tooltip can also be shown on customized location of
x
and y
by adding parentheses"()", for example,
wgt.setPopup('an_id', 'x=(zk.currentPointer[0] + 10), y=(zk.currentPointer[1] - 10)');
popup
- the popup widget.public void setTooltip(String tooltip)
Popup
) that should be used
as a tooltip window when the mouse hovers over the element for a moment.tooltip
- the ID of the popup widget.setPopup(zul.wgt.Popup)
public String getCtrlKeys()
Default: null.
public Widget setCtrlKeys(String keys)
The string could be a combination of the following:
For example,
keys
- protected boolean afterKeyDown_(Event evt, boolean simulated)
Widget.doKeyDown_(zk.Event)
is called and the event
propagation is not stopped.
Default: handles the control keys, including onOK and onCancel,
by searching up the ancestor chain to see if any one is listening.
If found, it calls beforeCtrlKeys_(zk.Event)
for each widget that were
searched, and then fire the event.
evt
- the widget event.simulated
- if the event was not sent to the widget originally (rather,
it is caused by pressing when none of widget but document gains the focus)setCtrlKeys(_global_.String)
protected boolean beforeCtrlKeys_(Event evt)
Default: does nothing (but return false) It is usually overridden by a stateful widget, such as an input box, to update its state to the server, such as firing the onChange event.
evt
- the widget event.public static Widget getOpenTooltip()
Copyright © 2005-2023 Potix Corporation. All Rights Reserved.