yesod-form-1.4.1.1: Form handling support for Yesod Web Framework

Safe HaskellNone
LanguageHaskell98

Yesod.Form.Fields

Contents

Synopsis

i18n

Fields

checkBoxField :: Monad m => RenderMessage (HandlerSite m) FormMessage => Field m Bool Source

While the default boolField implements a radio button so you can differentiate between an empty response (Nothing) and a no response (Just False), this simpler checkbox field returns an empty response as Just False.

Note that this makes the field always optional.

File AForms

Options

selectFieldList :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg) => [(msg, a)] -> Field (HandlerT site IO) a Source

radioFieldList :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg) => [(msg, a)] -> Field (HandlerT site IO) a Source

checkboxesFieldList :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg) => [(msg, a)] -> Field (HandlerT site IO) [a] Source

multiSelectFieldList :: (Eq a, RenderMessage site FormMessage, RenderMessage site msg) => [(msg, a)] -> Field (HandlerT site IO) [a] Source

data OptionList a Source

Constructors

OptionList 

Fields

olOptions :: [Option a]
 
olReadExternal :: Text -> Maybe a
 

optionsPersistKey :: (YesodPersist site, PersistEntity a, PersistQuery (PersistEntityBackend a), PathPiece (Key a), RenderMessage site msg, YesodPersistBackend site ~ PersistEntityBackend a) => [Filter a] -> [SelectOpt a] -> (a -> msg) -> HandlerT site IO (OptionList (Key a)) Source

An alternative to optionsPersist which returns just the Key instead of the entire Entity.

Since 1.3.2

optionsPairs :: (MonadHandler m, RenderMessage (HandlerSite m) msg) => [(msg, a)] -> m (OptionList a) Source