Fixed WSF_MULTI_CONTROL (wrong order of subcontrols), completed navbar, improved slider
This commit is contained in:
@@ -133,7 +133,7 @@ feature -- Execution
|
||||
|
||||
slider_demo (request: WSF_REQUEST; response: WSF_RESPONSE)
|
||||
local
|
||||
page: IMAGE_SLIDER_PAGE
|
||||
page: SLIDER_PAGE
|
||||
do
|
||||
-- To send a response we need to setup, the status code and
|
||||
-- the response headers.
|
||||
|
||||
@@ -24,8 +24,8 @@ feature
|
||||
navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/%"", "Home"))
|
||||
navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/grid%"", "Grid"))
|
||||
navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/repeater%"", "Repeater"))
|
||||
navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/slider%"", "Image Slider"))
|
||||
navbar.add_list_element_right (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"#%"", "About"))
|
||||
navbar.add_list_element (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/slider%"", "Slider"))
|
||||
navbar.add_list_element_right (create {WSF_BASIC_CONTROL}.make_with_body ("a", "href=%"/about%"", "About"))
|
||||
if not attached get_parameter ("ajax") then
|
||||
control.add_control (navbar)
|
||||
end
|
||||
|
||||
@@ -10,9 +10,9 @@ class
|
||||
inherit
|
||||
|
||||
BASE_PAGE
|
||||
redefine
|
||||
initialize_controls
|
||||
end
|
||||
redefine
|
||||
initialize_controls
|
||||
end
|
||||
|
||||
create
|
||||
make
|
||||
@@ -22,16 +22,16 @@ feature
|
||||
initialize_controls
|
||||
do
|
||||
Precursor
|
||||
control.add_control (create {WSF_BASIC_CONTROL}.make_with_body("h1","","Grid Demo"))
|
||||
control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h1", "", "Grid Demo"))
|
||||
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)
|
||||
control.add_control (search_query)
|
||||
control.add_control (create {WSF_BASIC_CONTROL}.make_with_body("h2","","Results"))
|
||||
create grid.make_grid ("mygrid", <<create {WSF_GRID_COLUMN}.make ("Title", "title"),
|
||||
create {WSF_GRID_COLUMN}.make ("Content", "content")>>, datasource)
|
||||
control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h2", "", "Results"))
|
||||
create grid.make_grid ("mygrid", <<create {WSF_GRID_COLUMN}.make ("Title", "title"), create {WSF_GRID_COLUMN}.make ("Content", "content")>>, datasource)
|
||||
control.add_control (grid)
|
||||
navbar.set_active (2)
|
||||
end
|
||||
|
||||
change_query
|
||||
|
||||
@@ -5,7 +5,7 @@ note
|
||||
revision: "$Revision$"
|
||||
|
||||
class
|
||||
IMAGE_SLIDER_PAGE
|
||||
SLIDER_PAGE
|
||||
|
||||
inherit
|
||||
|
||||
@@ -20,14 +20,20 @@ create
|
||||
feature -- Implementation
|
||||
|
||||
initialize_controls
|
||||
local
|
||||
form: WSF_FORM_CONTROL
|
||||
do
|
||||
Precursor
|
||||
create slider.make_slider ("myslider")
|
||||
create form.make_form_control ("sliderform")
|
||||
form.add_control (create {WSF_FORM_ELEMENT_CONTROL[STRING]}.make_form_element ("Input", create {WSF_INPUT_CONTROL}.make_input ("sliderformtext", "Test")))
|
||||
slider.add_control (form, Void)
|
||||
slider.add_image ("http://www.placesmustseen.com/wp-content/uploads/2013/01/paris-eiffel-tower.jpg", "Eiffel Tower")
|
||||
slider.add_image ("http://24.media.tumblr.com/0fcec9a7dde5b405a46b6fcda1ffad0c/tumblr_mtagkyYVIT1st5lhmo1_1280.jpg", "car")
|
||||
slider.add_image ("http://25.media.tumblr.com/d9e791508eb9a532aa7f258fa4e0fedc/tumblr_mtag5zve3g1st5lhmo1_1280.jpg", "landscape")
|
||||
control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h1", "", " Image Slider Demo"))
|
||||
control.add_control (slider)
|
||||
navbar.set_active (4)
|
||||
end
|
||||
|
||||
process
|
||||
|
||||
@@ -31,6 +31,7 @@ feature
|
||||
control.add_control (create {WSF_BASIC_CONTROL}.make_with_body ("h2", "", "Results"))
|
||||
create repeater.make_repeater ("myrepeater", datasource)
|
||||
control.add_control (repeater)
|
||||
navbar.set_active (3)
|
||||
end
|
||||
|
||||
change_query
|
||||
|
||||
Reference in New Issue
Block a user