Class ForEach

java.lang.Object
org.zkoss.web.servlet.dsp.action.AbstractAction
org.zkoss.web.servlet.dsp.action.ForEach
All Implemented Interfaces:
Action

public class ForEach extends AbstractAction
Iterators thru a collection/array of items.
Author:
tomyeh
  • Constructor Details

    • ForEach

      public ForEach()
  • Method Details

    • getVar

      public String getVar()
      Returns the variable name used to iterate thru items.
    • setVar

      public void setVar(String var)
      Sets the variable name used to iterate thru items.
    • getVarStatus

      public String getVarStatus()
      Returns the variable name used to hold the current iteration status, an instance of LoopStatus.
    • setVarStatus

      public void setVarStatus(String varStatus)
      Sets the variable name used to hold the current iteration status.
    • getItems

      public Object getItems()
      Returns the attribute items.
    • setItems

      public void setItems(Object items)
      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

      public void render(ActionContext ac, boolean nested) throws DspException, IOException
      Description copied from interface: Action
      Processes the action and renders the output to ActionContext.getOut().
      nested - whether there is any nested content.
      Throws:
      DspException
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object