[Seaside] Help understanding WATableReport
radoslav hodnicak
rh at 4096.sk
Mon Aug 23 17:14:44 CEST 2004
rows := #(1 2 3 4 5 6). "your data"
columns :=
OrderedCollection new
add: (WAReportColumn selector: #yourself title: 'original');
"selector gets perform:-ed on your data item"
add: (WAReportColumn selector: #factorial title: 'factorial');
"or if you want more control"
add: (WAReportColumn new
valueBlock: [:rowItem| rowItem even ifTrue: ['even'] ifFalse: ['odd']];
clickBlock: [:rowItem| self inform: 'you clicked ', rowItem asString];
title: 'odd/even');
yourself.
^WATableReport new rows: rows; columns: columns; yourself.
produces table like
original factorial odd/even
1 1 odd
2 2 even
3 6 odd
4 24 even
5 120 odd
6 720 even
with the items in 3rd column clickable
More information about the Seaside
mailing list