WORepitions
Open up a WOComponent in WOBuilder and add a WORepition

Bind an NSArray of items to its list
binding and bind an instance of the class ( of the same type that is in the
NSArray) to the WORepitions item binding. For example if you had an NSArray
of Students, then you would need to bind an instance of Student to the WORepition's
item.
Now anything that you add inside the WORepition box is
going to be repeated for the number of elements in the array.
So we could add a WOString and bind it to the lastName of the instance of Student
we have bound to the WORepitions item.
This means that at run time WebObjects will itereate through the array of students
and produce the same bit of HTML for all of them, but each time using the next
Student in the array. So in this case we would have the list of the students
last names displayed on the screen.
There is a binding called index which allows you to show where
you are up to in the WORepition. It needs to be bound to a int.
NOTE : As
it is coming from an array the count starts at 0, not 1.
The same princaple of a list and an istance of a object of the
type of things in the list also applies to WOBrowser and WOPopUpList's.
The most commonly repeated HTML elements ( besides displaying the information
) are radio buttons and check boxes.
Radio buttons are fairly simple as they only allow one selection,
while checkbox's allow multiple selections, thus you need to keep track
of selected elements.
Lect 4 Demo 1 ( Download )
Page updated
September 2, 2004
|