Today's Smalltalk Daily looks at how you can customize a query for one of the standard scaffolding UIs in WebVelocity. The code added is all in class NoteListUI. To jump to the video, Click here
First, add a variable, searchText
renderActionsOn: html
super renderActionsOn: html.
html text: 'Search'.
html space.
html textInput on: #searchText of: self.
html button
callback: [self applySearch];
value: 'Search'.
html button
callback: [self returnToAll];
value: 'All'
applySearch
"do the search"
| query newSearchText |
query := Glorp.ActiveRecords.Query read: Note.
newSearchText := '%', self searchText asLowercase, '%'.
query where: [:each | each title asLowercase like: newSearchText].
paginator query: query.
returnToAll
| query |
query := Glorp.ActiveRecords.Query read: Note.
paginator query: query.
Click on the viewer below to watch it now:
If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.
You can also watch it on YouTube:
Technorati Tags:
smalltalk, seaside, webvelocity, database