Lukas et-al,
I've got my test Magritte form working from a renderContentOn: block
without issue (data is displayed,buttons exist,no complaints, etc)..
Anyway, at the bottom of the form (using the code below) are 3 buttons
(save,cancel and then my 'done' button).. The thing I'm having a hard
time with (which was easy when using #call and #answer) is how to
determine what button was pressed (save,cancel).. Ideally, I don't
care to have a "done" button but I do need to distinguish between save
and cancel.. What's the best approach for this? I copied the
onAnswer: block from another old Magritte email thread but its only
called when cancel is pressed.. Thx!
renderContentOn: html
component := (self session user) asComponent addValidatedForm;
onAnswer: [ :value | self answer: value ];
yourself.
html div id: 'fullwidthContent'; with: [
html div id: #fieldsetEnclosure; with: [
html render: component.
html submitButton
callback: [self answer: 'foo'];
text: 'Done'
]
]
-- Rick