<a:For>

AWFor is the fundamental unrolling contruct for repeated content. It's body is re-evaluated for each item in the supplied list.

Typical use:

<a:For item="$currentItem" list="$myItems">
    <tr>
        <td>$currentItem.name</td>
        <td>$currentItem.description</td>
    </tr>
</a:For>
Bindings
list *

This list (java.util.List, native Array, etc) containing the items being unrolled.

AWOrderedList
(get)
item

Binding pushed into for each iteration

Object
(set)
count

Maximum number of items to iterate over

int
(get)
index

Binding pushed with the index of the current item

int
(set)
start

The index of the initial item to be unrolled. (Can be used in concert with count to process a sub-section of the list)

int
(get)
scopeSubcomponentsByItem

Rarely used (use with caution). Normally any stateful subcomponents in a repetition are associated by position (index). If, instead, they should be associated by the object identity of the items in the loop, scopeSubcomponentsByItem can be set to true. (This can be useful in contexts where, for instance, items in a table can shift position and any stateful components in the table should "move" with their items).

boolean
(get)

ariba.ui.aribaweb.core
Class AWFor

java.lang.Object
  extended by ariba.ui.aribaweb.util.AWBaseObject
      extended by ariba.ui.aribaweb.core.AWBaseElement
          extended by ariba.ui.aribaweb.core.AWBindableElement
              extended by ariba.ui.aribaweb.core.AWContainerElement
                  extended by ariba.ui.aribaweb.core.AWFor
All Implemented Interfaces:
AWBindable, AWCycleable, AWCycleableReference, AWElement, AWElementContaining, AWVisitable, AWObject, java.lang.Cloneable

public class AWFor
extends AWContainerElement


Constructor Summary
AWFor()
           
 
Method Summary
 AWBinding _count()
           
 AWBinding _index()
           
 AWBinding _item()
           
 AWBinding _itemClassName()
           
 AWBinding _list()
           
 java.lang.Object _orderedListInComponent(AWComponent component)
           
 AWBinding _start()
           
 int _startIndex(AWComponent component)
           
 void applyValues(AWRequestContext requestContext, AWComponent component)
          The receiver should take any form values (or query string parameters) that it owns from the AWRequestContext.request().
 void init(java.lang.String tagName, java.util.Map bindingsHashtable)
           
 AWResponseGenerating invokeAction(AWRequestContext requestContext, AWComponent component)
          The receiver should determine if it is the intended recipient of the current action (by checking the AWRequestContext.request() AWRequest.senderId()) and, if so, handle the action and return the result.
 void renderResponse(AWRequestContext requestContext, AWComponent component)
          The receiver should render its content to the AWRequestContext.response()
 java.lang.String toString()
           
 
Methods inherited from class ariba.ui.aribaweb.core.AWContainerElement
add, appendTo, contentElement, continueVisit, setContentElement, validate
 
Methods inherited from class ariba.ui.aribaweb.core.AWBindableElement
allBindings, determineInstance, tagName
 
Methods inherited from class ariba.ui.aribaweb.core.AWBaseElement
bareStringContent, clone, determineInstance, lineNumber, setLineNumber, setTemplateName, startVisit, templateName
 
Methods inherited from class ariba.ui.aribaweb.util.AWBaseObject
debugString, ensureFieldValuesClear, getFieldValue, init, isKindOfClass, localizedJavaString, logString, logWarning, setFieldValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ariba.ui.aribaweb.core.AWElement
clone
 
Methods inherited from interface ariba.ui.aribaweb.core.AWCycleableReference
determineInstance
 
Methods inherited from interface ariba.ui.aribaweb.util.AWObject
getFieldValue, init, isKindOfClass, setFieldValue
 
Methods inherited from interface ariba.ui.aribaweb.core.AWVisitable
startVisit
 

Constructor Detail

AWFor

public AWFor()
Method Detail

init

public void init(java.lang.String tagName,
                 java.util.Map bindingsHashtable)
Specified by:
init in interface AWBindable
Overrides:
init in class AWBindableElement

_list

public AWBinding _list()

_item

public AWBinding _item()

_count

public AWBinding _count()

_index

public AWBinding _index()

_start

public AWBinding _start()

_itemClassName

public AWBinding _itemClassName()

_startIndex

public final int _startIndex(AWComponent component)

_orderedListInComponent

public java.lang.Object _orderedListInComponent(AWComponent component)

applyValues

public void applyValues(AWRequestContext requestContext,
                        AWComponent component)
Description copied from interface: AWCycleable
The receiver should take any form values (or query string parameters) that it owns from the AWRequestContext.request().

Specified by:
applyValues in interface AWCycleable
Overrides:
applyValues in class AWContainerElement
Parameters:
requestContext - the context for the current request.
component - the current parent component

invokeAction

public AWResponseGenerating invokeAction(AWRequestContext requestContext,
                                         AWComponent component)
Description copied from interface: AWCycleable
The receiver should determine if it is the intended recipient of the current action (by checking the AWRequestContext.request() AWRequest.senderId()) and, if so, handle the action and return the result.

Specified by:
invokeAction in interface AWCycleable
Overrides:
invokeAction in class AWContainerElement
Parameters:
requestContext - the context for the current request.
component - the current parent component
Returns:
the response for the action

renderResponse

public void renderResponse(AWRequestContext requestContext,
                           AWComponent component)
Description copied from interface: AWCycleable
The receiver should render its content to the AWRequestContext.response()

Specified by:
renderResponse in interface AWCycleable
Overrides:
renderResponse in class AWContainerElement
Parameters:
requestContext - the context for the current request.
component - the current parent component

toString

public java.lang.String toString()
Overrides:
toString in class AWBaseElement


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.