Customizing a Cincom® WebVelocity™ Query

投稿日: 2010年8月19日, 投稿者: Jeremy Jordan

A look at how you customize a query for one of the standard scaffolding UIs in WebVelocity.

A look at how you customize a query for one of the standard scaffolding UIs in WebVelocity. The code added is all in class NoteListUI:

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.

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.

Leave a Reply

Spam Protection by WP-SpamFree



過去のニュース