You need to ensure that you have a very recent (533 or later) version of Seaside for the defaultButton behaviour to take effect correctly. If you're using multiple decorators, don't forget to make the FormDecoration the last one you apply.
WAComponent subclass: #SimpleTestForm
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Sample'
initialize
| form |
super initialize.
form := WAFormDecoration new buttons: self buttons.
self addDecoration: form.
buttons
^ #(okay cancel)
okay
"your action goes here"
self inform: 'you pressed okay'
cancel
"your action goes here"
self inform: 'you cancelled'
defaultButton
^ self buttons first
renderContentOn: html
"usual form contents go here"
html textInput.
html text: 'asd'
"etc"
No comments:
Post a Comment