How do I get a component to return to whoever called it, when it finishes?
For example, I have a PMLogsView class that displays a list of records. It also contains a link to PMLogAddItem class. PMLogAddItem displays a form. When it is submitted, it adds a record to the database and redisplays itself so that another record can be added. I would rather it returned instead to the calling class. ( PMLogsView).
PMLogsView>>RenderContentOn: html " . . ."
html anchorWithAction: [self call: PMLogAddItem new] text: 'Add'.
" . . ." -------------------------
-Larry
LK wrote:
How do I get a component to return to whoever called it, when it finishes?
The component should send #answer or #answer: (the former returns nil as the result of the original #call: while the later returns the specified value).
So, in your editor your submit callback could look something like:
PMLogAddItem>>submitPressed ...add item to DB... self answer
David
seaside@lists.squeakfoundation.org