Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The iterator tag iterates over a collection of elements in a collection object in a named attribute. The individual elements are placed in a pageContext attribute, and made available in the JSP Java context for use in scriptlets.

Attribute NameRequired?ExprVal?Description
ameYNThe name of the attribute that the collection of elements will come from. Can be in the page, request, session or application contexts.
propertyNNThe name of the attribute and Java variable that the individual elements will be put into as the iterator iterates.
typeNNThe type of the elements within the collections. This must be specified so that the Java context variable can be created. Defaults to org.ofbiz.entity.GenericValue, which is one of the more common objects to iterate over in OFBiz framework based applications.
expandMapNNIf expandMap is true then the iterator elements must implement the Map interface the the keys in the Map entries must be Strings. Each map entry will be put into the pageContext if this is set using the Map key value as the attribute name. Must be true or false. Defaults to false.
offsetNYIf specified the iteration will start at the given offset index instead of at the beginning of the collection.
limitNYIf specified only the specified number of iterations will be done. In other words this limits the number of elements pulled from the iterator.
Sub-Element NameHow ManyDescription
iterateNext0 to manyDescribed below.
iteratorHasNext0 to manyDescribed below.

ofbiz:iteratorNext

Grab the next element in the collection of the parent iterator tag.

Attribute NameRequired?ExprVal?Description
nameNNThe name of the attribute to put the element in. Defaults to the name specified in the property attribute of the parent iterator tag.
typeNNThe type of the elements within the collections. This must be specified so that the Java context variable can be created. Defaults to org.ofbiz.entity.GenericValue, which is one of the more common objects to iterate over in OFBiz framework based applications.
expandMapNNIf expandMap is true then the iterator elements must implement the Map interface the the keys in the Map entries must be Strings. Each map entry will be put into the pageContext if this is set using the Map key value as the attribute name. Must be true or false. Defaults to false.

ofbiz:iteratorHasNext

Only process body if parent iterator tag has another entry.

This tag has no attributes.

Data Presentation Tags

ofbiz:format

Formats dates, numbers and currencies from the value in the body of the tag. It has one attribute that specifies how the text should be formatted.

Attribute NameRequired?ExprVal?Description
typeNNSpecified how the type of format to apply to the body value. Must be "currency", "number", or "date". If not type is specified the original value is printed.

ofbiz:print

Prints an attribute from the pageContext. If null prints the default value or nothing if no default is specified.

Attribute NameRequired?ExprVal?Description
attributeYYThe name of the attribute to print.
defaultNYThe default value to print if the specified attribute is not found.

ofbiz:field

Displays a properly formatted string from field in the specified attribute.

Attribute NameRequired?ExprVal?Description
attributeYNThe name of the attribute that contains the field to print.
typeNNOptionally specifies the type of the field to print. Can be "currency" or any of the Java field types. If not specified the tag will automatically determine the Java type.
defaultNYThe default value to print if the specified field is not found.
prefixNNIf the resulting message is not empty this string will be printed before the field value.
suffixNNIf the resulting message is not empty this string will be printed after the field value.

ofbiz:entityfield

Displays a properly formatted localized string from a field in the entity in the specified attribute. The prefix and suffix attribute contents will print before/after if the field is not null or empty.