[Seaside] Change normal button for colour (again)
Rubén Parra Savall
kenterish at hotmail.com
Mon Jun 4 17:42:32 UTC 2007
Thanks for trying to help me before, but I proved everything was in my scope
and it was impossible to solve my problem yet. Maybe the code clarify
more.(Omit the unnecessary for this case)
I have the main renderContentOn that calls renderCell
html table: [
1 to: 10 do: [ :row |
html tableRow: [
1 to: 10 do: [ :col |
html tableData: [ self renderCell: row @ col on: html ] ] ] ] ] .
Each cell has a value, at first is zero, but if you submit the button, it
changes, and with this, here we have the point, it should change of colour
or stay with another if the value isn't changed. Now just show the value
renderCell: aPoint on: html
| value |
value := self model boardAt2: aPoint. "Method to extract the value of the
point in the array"
html submitButtonWithAction: [
value isZero ifTrue: [ bool := (self model checkValue: aPoint).
(bool == true) ifTrue: [ self model boardAt2: aPoint put: 1.
self answer: self model. ]
ifFalse: [ self inform: ' Error'. ] .
ifFalse: [ self inform: ' Error '. ] .
text: (value isZero
ifTrue: [ ' ' ]
ifFalse: [ value ] ) .
Thanks very much, any help is more than welcome
Un amor, una aventura, compañía para un viaje. Regístrate gratis en MSN Amor
& Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349
More information about the Seaside