Safe Haskell | None |
---|
- data View v = forall a m . Monad m => View {
- viewName :: Text
- viewContext :: Path
- viewForm :: FormTree Identity v m a
- viewInput :: [(Path, FormInput)]
- viewErrors :: [(Path, v)]
- viewMethod :: Method
- getForm :: Monad m => Text -> Form v m a -> m (View v)
- postForm :: Monad m => Text -> Form v m a -> Env m -> m (View v, Maybe a)
- subView :: Text -> View v -> View v
- subViews :: View v -> [View v]
- absolutePath :: Text -> View v -> Path
- absoluteRef :: Text -> View v -> Text
- viewEncType :: View v -> FormEncType
- fieldInputText :: forall v. Text -> View v -> Text
- fieldInputChoice :: forall v. Text -> View v -> [(Text, v, Bool)]
- fieldInputChoiceGroup :: forall v. Text -> View v -> [(Text, [(Text, v, Bool)])]
- fieldInputBool :: forall v. Text -> View v -> Bool
- fieldInputFile :: forall v. Text -> View v -> Maybe FilePath
- listSubViews :: forall v. Text -> View v -> [View v]
- makeListSubView :: Text -> Int -> View v -> View v
- errors :: Text -> View v -> [v]
- childErrors :: Text -> View v -> [v]
- debugViewPaths :: View v -> [Path]
Documentation
Obtaining a view
Operations on views
Querying a view
Low-level
absoluteRef :: Text -> View v -> TextSource
Determine an absolute path and call fromPath
on it. Useful if you're
writing a view library...
Form encoding
viewEncType :: View v -> FormEncTypeSource
Input
fieldInputText :: forall v. Text -> View v -> TextSource
fieldInputChoice :: forall v. Text -> View v -> [(Text, v, Bool)]Source
Returns a list of (identifier, view, selected?)
fieldInputChoiceGroup :: forall v. Text -> View v -> [(Text, [(Text, v, Bool)])]Source
Returns a list of (groupName, [(identifier, view, selected?)])
fieldInputBool :: forall v. Text -> View v -> BoolSource
List subview
listSubViews :: forall v. Text -> View v -> [View v]Source
Creates a sub view
Errors
childErrors :: Text -> View v -> [v]Source
Debugging
debugViewPaths :: View v -> [Path]Source