Google news example

This commit is contained in:
YNH Webdev
2013-09-14 17:46:57 +02:00
parent 95f823e7a1
commit 26ec7d94c6
13 changed files with 333 additions and 15 deletions

View File

@@ -18,17 +18,34 @@ feature
initialize_controls
local
ds: DEMO_DATASOURCE
container: WSF_MULTI_CONTROL [WSF_STATELESS_CONTROL]
do
create ds.make_demo
create grid.make_grid ("mygrid", <<create {WSF_GRID_COLUMN}.make_column ("#", "id"), create {WSF_GRID_COLUMN}.make_column ("Name", "name"), create {WSF_GRID_COLUMN}.make_column ("Description", "description")>>, ds)
control := grid
create container.make_multi_control ("container")
create datasource.make_news
create search_query.make_autocomplete ("query", create {GOOGLE_AUTOCOMPLETION}.make)
search_query.add_class ("form-control")
search_query.set_change_event (agent change_query)
container.add_control (search_query)
create grid.make_grid ("mygrid", <<create {WSF_GRID_COLUMN}.make_column ("Title", "title"), create {WSF_GRID_COLUMN}.make_column ("Content", "content"), create {WSF_GRID_IMAGE_COLUMN}.make_image_column ("Image", "image")>>, datasource)
container.add_control (grid)
control := container
end
change_query
do
datasource.set_query (search_query.value)
datasource.set_page (1)
datasource.update
end
process
do
end
grid: WSF_GRID_CONTROL [DEMO_DATA]
grid: WSF_GRID_CONTROL [GOOGLE_NEWS]
search_query: WSF_AUTOCOMPLETE_CONTROL
datasource: GOOGLE_NEWS_DATASOURCE
end