|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zkmax.zul.Cardlayout
public class Cardlayout
A layout allow end user change view like change card.
The selectedIndex decide which child component will be shown (aka in view port).
Notice: When remove child, selectedIndex will decrease if last child is selected
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
HtmlBasedComponent.ExtraCtrl |
| Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
AbstractComponent.Children |
| Field Summary |
|---|
| Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
_zclass |
| Fields inherited from interface org.zkoss.zk.ui.Component |
|---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
| Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl |
|---|
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE |
| Constructor Summary | |
|---|---|
Cardlayout()
|
|
| Method Summary | |
|---|---|
java.lang.String |
getOrient()
Returns the orient. |
int |
getSelectedIndex()
Return the index of the component in view port. |
boolean |
insertBefore(Component newChild,
Component refChild)
Inserts a child before the reference child. |
boolean |
isHorizontal()
Returns whether it is a horizontal . |
boolean |
isVertical()
Returns whether it is a vertical . |
boolean |
next()
Change to next component if possible. |
boolean |
previous()
Change to previous component if possible. |
boolean |
removeChild(Component child)
Removes a child. |
protected void |
renderProperties(ContentRenderer renderer)
Renders the content of this component, excluding the enclosing tags and children. |
void |
service(AuRequest request,
boolean everError)
Swipe event on client will fire onChange to server to set selected index. |
void |
setOrient(java.lang.String orient)
Sets the orient. |
void |
setSelectedIndex(int value)
Note: Unlike other component, "deselect" is unnecessary in Cardlayout. |
| Methods inherited from class org.zkoss.zul.impl.XulElement |
|---|
clone, getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeightDirectly, setHflex, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTooltiptext, setTop, setTopDirectly, setVflex, setWidth, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Cardlayout()
| Method Detail |
|---|
public java.lang.String getOrient()
Default: "horizontal".
public void setOrient(java.lang.String orient)
throws WrongValueException
orient - either horizontal or vertical
WrongValueException - if orient is not horizontal or vertical.public boolean isHorizontal()
public boolean isVertical()
public int getSelectedIndex()
public void setSelectedIndex(int value)
Note: Unlike other component, "deselect" is unnecessary in Cardlayout. So the index value can't be negative, if do so, it will occur an UiException.
value -
public boolean insertBefore(Component newChild,
Component refChild)
ComponentYou could use Component.setParent(org.zkoss.zk.ui.Component) or Component.appendChild(org.zkoss.zk.ui.Component)
instead of this method, unless
you want to control where to put the child.
Note: Component.setParent(org.zkoss.zk.ui.Component) always calls back Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
and/or Component.removeChild(org.zkoss.zk.ui.Component),
while Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and Component.removeChild(org.zkoss.zk.ui.Component)
always calls back Component.setParent(org.zkoss.zk.ui.Component),
if the parent is changed. Thus, you don't need to override
both Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and Component.setParent(org.zkoss.zk.ui.Component), if you want
to customize the behavior.
If you would like to monitor if a component is attached or detached
from a page, you could register a desktop listener implementing
UiLifeCycle.
insertBefore in interface ComponentinsertBefore in class AbstractComponentnewChild - the new child to be inserted.refChild - the child before which you want the new child
being inserted. If null, the new child is append to the end.
public boolean removeChild(Component child)
ComponentComponent.detach()) and it will be removed
if it is no longer used.
You could use Component.setParent(org.zkoss.zk.ui.Component) with null instead of this method.
Note: Component.setParent(org.zkoss.zk.ui.Component) always calls back Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
and/or Component.removeChild(org.zkoss.zk.ui.Component),
while Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and Component.removeChild(org.zkoss.zk.ui.Component)
always calls back Component.setParent(org.zkoss.zk.ui.Component),
if the parent is changed. Thus, you don't need to override
both Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and Component.setParent(org.zkoss.zk.ui.Component), if you want
to customize the behavior.
If you would like to monitor if a component is attached or detached
from a page, you could register a desktop listener implementing
UiLifeCycle.
removeChild in interface ComponentremoveChild in class AbstractComponent
protected void renderProperties(ContentRenderer renderer)
throws java.io.IOException
HtmlBasedComponentSee also ZK Client-side Reference: Property Rendering
renderProperties in class XulElementjava.io.IOExceptionpublic boolean previous()
public boolean next()
public void service(AuRequest request,
boolean everError)
service in interface ComponentCtrlservice in class HtmlBasedComponenteverError - whether any error ever occurred before
processing this request.HtmlBasedComponent.service(org.zkoss.zk.au.AuRequest, boolean)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||