MFlow  Create and maintain dynamic Web applications as easy and fast as console applications
Thou shall not write request handlers
 This release: 11/06/2014.  agocorona@gmail.com (@agocorona) <>< . issues & bugs .  Mflow Source code,     source code of this site




Combo box

Shows how the select-options combo box are programmed in MFlow



Running example

(in the light red box):


Source code:

{-# OPTIONS -XCPP #-} 
module Options (options) where

-- #define ALONE -- to execute it alone, uncomment this
#ifdef ALONE
import MFlow.Wai.Blaze.Html.All
main= runNavigation "" $ transientNav options
#else
import MFlow.Wai.Blaze.Html.All hiding(page)
import Menu
#endif

options= do
   r <- page  $ getSelect (setSelectedOption ""  (p <<  "select a option") <|>
                         setOption "red"  (b <<  "red")                  <|>
                         setOption "blue" (b <<  "blue")                 <|>
                         setOption "Green"  (b <<  "Green")  )
                         <! dosummit
   page  $ p << (r ++ " selected") ++> wlink () (p <<  " menu")


   where
   dosummit= [("onchange","this.form.submit()")]

-- to run it alone, change page by ask and uncomment this:
--main= runNavigation "" $ transientNav options

comments powered by Disqus