Package org.zkoss.web.servlet.dsp.action
Class ForEach
java.lang.Object
org.zkoss.web.servlet.dsp.action.AbstractAction
org.zkoss.web.servlet.dsp.action.ForEach
- All Implemented Interfaces:
Action
Iterators thru a collection/array of items.
- Author:
- tomyeh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetBegin()Returns the index of the item at which the iteration begins.intgetEnd()Returns the index of the item at which the iteration ends (inclusive).getItems()Returns the attribute items.getVar()Returns the variable name used to iterate thru items.Returns the variable name used to hold the current iteration status, an instance ofLoopStatus.booleanisTrim()Returns whether to trim the result.voidrender(ActionContext ac, boolean nested) Processes the action and renders the output toActionContext.getOut().voidsetBegin(int beg) Sets the index of the item at which the iteration begins.voidsetEnd(int end) Sets the index of the item at which the iteration ends (inclusive).voidSets the attribute items.voidsetTrim(boolean trim) Sets whether to trim the result.voidSets the variable name used to iterate thru items.voidsetVarStatus(String varStatus) Sets the variable name used to hold the current iteration status.toString()Methods inherited from class org.zkoss.web.servlet.dsp.action.AbstractAction
append, append, append, getIf, getUnless, isEffective, setIf, setUnless, toScope
-
Constructor Details
-
ForEach
public ForEach()
-
-
Method Details
-
getVar
Returns the variable name used to iterate thru items. -
setVar
Sets the variable name used to iterate thru items. -
getVarStatus
Returns the variable name used to hold the current iteration status, an instance ofLoopStatus. -
setVarStatus
Sets the variable name used to hold the current iteration status. -
getItems
Returns the attribute items. -
setItems
Sets the attribute items. -
getBegin
public int getBegin()Returns the index of the item at which the iteration begins. -
setBegin
public void setBegin(int beg) Sets the index of the item at which the iteration begins.Default: 0.
-
getEnd
public int getEnd()Returns the index of the item at which the iteration ends (inclusive). -
setEnd
public void setEnd(int end) Sets the index of the item at which the iteration ends (inclusive).Default: Integer.MAX_VALUE.
-
isTrim
public boolean isTrim()Returns whether to trim the result. -
setTrim
public void setTrim(boolean trim) Sets whether to trim the result.Default: true.
-
render
Description copied from interface:ActionProcesses the action and renders the output toActionContext.getOut().nested- whether there is any nested content.- Throws:
DspExceptionIOException
-
toString
-