Inherited by ERXGroupingTable.

Public Member Functions | |
| ERXGroupingRepetition (WOContext aContext) | |
| void | reset () |
| Object | sectionItem () |
| String | sectionKey () |
| NSArray | sections () |
| void | setSectionItem (Object section) |
Static Public Attributes | |
| static final Logger | log = Logger.getLogger(ERXGroupingRepetition.class) |
Private Member Functions | |
| Object | keyForSection (Object section) |
| boolean | splitArrays () |
Private Attributes | |
| NSMutableDictionary | _itemsPerSection = new NSMutableDictionary() |
| Object | _sectionItem |
| String | _sectionKey |
| NSMutableArray | _sections |
| Boolean | _splitArrays |
Static Private Attributes | |
| static final Object | NULL = "N/A" |
[erxgroupingrepetition]
[wostring value=currentDepartment.name]
[worepetition list=currentEmployees item=currentEmployee]
[wostring value=currentEmployees.firstName]
[/worepetition]
[/erxgroupingrepetition]
and then you'd set up the bindings of the grouping repetition like:
list=allEmployees : list of employees to group item=currentEmployee : will be set so the next key can get evaluated sectionForItem=departmentForCurrentEmployee : a method in the parent that returns sth like currentEmployee.department() sectionKey="name" : assuming department has a name, but can be unbound; note that you can group on "city", too! subListSection=currentDepartment : instance variable in the parent that will get set to the current department subList=currentEmployees : instance variable in the parent that will get set to the employees of the current department sortKey=".name" : sorts the department list by name
If a user could belong to many departments, you could either set the
splitArrays binding to true, in which case the sections would be all the departments and the user would be added in each section he belongs or you could leave it out. Then the sections will be each combination of departments a user belongs to. Please see the page BugsPerUser.wo from the BugTracker application to find another example on how to use it. list list of objects to group item current item, will get pushed to the parent, so that it can evaluate sectionForItem sectionForItem value pulled from the parent, after "item" gets pushed sectionKey key to group departments on (usually primaryKey or hashCode) subListSection will get set to the current section subList will get set to the grouped items for the section sortKey optional key for sorting the group list (sth like '.name') splitArrays optional boolean specifying if array keys are regarded as distinct keys ignoreNulls optional boolean specifying if nulls are ignored | ERXGroupingRepetition | ( | WOContext | aContext | ) |
| Object keyForSection | ( | Object | section | ) | [private] |
| splitArrays | ||
| section |
| void reset | ( | ) |
Reimplemented from ERXStatelessComponent.
| Object sectionItem | ( | ) |
| String sectionKey | ( | ) |
| NSArray sections | ( | ) |
| void setSectionItem | ( | Object | section | ) |
| boolean splitArrays | ( | ) | [private] |
NSMutableDictionary _itemsPerSection = new NSMutableDictionary() [private] |
Object _sectionItem [private] |
String _sectionKey [private] |
NSMutableArray _sections [private] |
Boolean _splitArrays [private] |
final Object NULL = "N/A" [static, private] |
1.5.8