Documentation Archive Developer
Search
PATH Documentation > WebObjects

Table of Contents

WONestedList



Element Description

WONestedList recursively displays a hierarchical, ordered (numbered) or unordered (bulleted) list of hyperlinks. This element is useful when you want to display hierarchical lists. When the user clicks one of the objects in the list, it is returned in selection and the action method is invoked.

At any point during iteration of the list, the method specified by the sublist attribute returns the current list's sublist (if any), level specifies the current nesting level (where the topmost level is zero), index gives index of the current item within that nesting level (item returns the actual item), and isOrdered specifies whether the current sublist should be a numbered list or a bulleted list.


Synopsis

WONestedList { list=anObjectList; item=anIteratedObject; displayString=displayedValue; sublist = aSubarray; action=aMethod; selection=selectedValue; [index=aCurrentIndex;] [level=aCurrentLevel;] [isOrdered=aBoolean;] [prefix=prefixString;] [suffix=suffixString;] [escapeHTML=aBoolean;]... };

Bindings

list
Hierarchical array of objects that the WONestedList will iterate through.
item
Current item in the list array. (This attribute's value is updated with each iteration.)
displayString
String to display as a hyperlink for the current item.
sublist
Method that returns the sublist of the current item or nil if the current item is a leaf.
action
Action method to invoke when the element is activated. This method must return a WOElement.
selection
When the page is submitted, selection contains the item that the user clicked.
index
Index of the current iteration of the WONestedList. The index is unique to each level-that is, it starts at 0 for each sublist.
level
Nesting level of the current iteration of the WONestedList. The topmost level is level 0.
isOrdered
If isOrdered evaluates to true (or YES), the current sublist is rendered as an ordered list. The default is to render as an unordered list.
prefix
An arbitrary HTML string inserted before each value.
suffix
An arbitrary HTML string inserted after each value.
escapeHTML
If escapeHTML evaluates to true (or YES), the string rendered by displayString is converted so that characters which would be interpreted as HTML control characters become their escaped equivalent (this is the default). Thus, if a your displayString is "a <b>bold</b> idea", the string passed to the client browser would be "a <B>bold</B> idea", but it would display in the browser as "a <b>bold</b> idea". If escapeHTML evaluates to false (or NO), WebObjects simply passes your data to the client browser "as is." In this case, the above example would display in the client browser as "a bold idea". If you are certain that your strings have no characters in them which might be interpreted as HTML control characters, you get better performance if you set escapeHTML to false (or NO).

Table of Contents