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

Safe HaskellNone

Yesod.Form.Fields

Contents

Synopsis

i18n

Fields

newtype Textarea Source

A newtype wrapper around a Text that converts newlines to HTML br-tags.

Constructors

Textarea 

Fields

unTextarea :: Text
 

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

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) aSource

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

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 (YesodPersistBackend site (HandlerT site IO)), PathPiece (Key a), RenderMessage site msg, PersistEntityBackend a ~ PersistMonadBackend (YesodPersistBackend site (HandlerT site IO))) => [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