org.jbpm.formModeler.service.bb.mvc.taglib.formatter
Class ForFormatter
java.lang.Object
org.jbpm.formModeler.service.bb.mvc.taglib.formatter.Formatter
org.jbpm.formModeler.service.bb.mvc.taglib.formatter.ForFormatter
@Named(value="org.jbpm.formModeler.service.mvc.formatters.ForFormatter")
public class ForFormatter
- extends Formatter
This class extends Formatter to provide support for iteration through a list.
It expects the following input parameters:
- array. List of objects to render. Optional, but if it is empty or null, nothing is rendered.
- nullValue. Value to display for the null items in the list. Optional, if not set, the null item is rendered.
- bean. If array is missing or null, and a Factory element is passed, use it as array.
- property. If array is missing or null, and bean is specified, use this property as array to iterate.
- sortProperties. If you want array properties to be sorted, use a string like "+property -property +property"
It serves the following output fragments, with given output parameters:
- outputStart. At the beginning of the iteration, if the list is not empty
- output. For every item in the list. It receives the following attributes:
- index. 0-based position of item in the list.
- count. 1-based position of item in the list.
- element. Element being displayed, or the nullValue parameter when it is null.
- outputEnd. At the end of the iteration, if the list is not empty.
- empty.If the list is empty.
| Methods inherited from class org.jbpm.formModeler.service.bb.mvc.taglib.formatter.Formatter |
afterRendering, getLang, getLocale, getLocaleManager, getParameter, includePage, renderFragment, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeInterpreter, setTag, writeToOut |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ForFormatter
public ForFormatter()
service
public void service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws FormatterException
- Description copied from class:
Formatter
- Perform the required logic for this Formatter. Inside, the methods
setAttribute and renderFragment are intended to be used to generate the
output and set parameters for this output.
Method getParameter is intended to retrieve input parameters by name.
Exceptions are to be catched inside the method, and not to be thrown, normally,
formatters could use a error fragment to be displayed when an error happens
in displaying. But if the error is unexpected, it can be wrapped inside a
FormatterException.
- Specified by:
service in class Formatter
- Parameters:
request - user requestresponse - response to the user
- Throws:
FormatterException - in case of an unexpected exception.
getSortedIterator
protected Iterator getSortedIterator(Iterator iterator,
String sortProperties)
shutdown
public void shutdown()
init
public void init()
Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.