Safe HaskellNone

IHP.View.Form

Documentation

class ModelFormAction application record where Source #

Methods

modelFormAction :: record -> Text Source #

Instances

Instances details
(HasField "id" record id, controller ~ ModelControllerMap application (NormalizeModel record), HasPath controller, AutoRoute controller, Eq id, Default id) => ModelFormAction application record Source # 
Instance details

Defined in IHP.View.Form

Methods

modelFormAction :: record -> Text Source #

data FormField Source #

Instances

Instances details
ToHtml FormField Source # 
Instance details

Defined in IHP.View.Form

Methods

toHtml :: FormField -> Html Source #

data SubmitButton Source #

Constructors

SubmitButton 

Fields

Instances

Instances details
ToHtml SubmitButton Source # 
Instance details

Defined in IHP.View.Form

Methods

toHtml :: SubmitButton -> Html Source #

data FormContext model Source #

Constructors

FormContext 

Fields

formFor :: forall record viewContext parent id application. (?viewContext :: viewContext, Eq record, Typeable record, ModelFormAction application record, HasField "id" record id, HasPath (ModelControllerMap application (NormalizeModel record)), application ~ ViewApp viewContext, HasField "meta" record MetaBag, Default id, Eq id) => record -> ((?viewContext :: viewContext, ?formContext :: FormContext record) => Html) -> Html Source #

formFor' :: forall record viewContext parent id application. (?viewContext :: viewContext, Eq record, Typeable record, HasField "id" record id, application ~ ViewApp viewContext, HasField "meta" record MetaBag, Default id, Eq id) => record -> Text -> ((?viewContext :: viewContext, ?formContext :: FormContext record) => Html) -> Html Source #

horizontalFormFor :: forall record viewContext parent id application. (?viewContext :: viewContext, Eq record, Typeable record, ModelFormAction application record, HasField "id" record id, HasPath (ModelControllerMap application record), application ~ ViewApp viewContext, HasField "meta" record MetaBag, Default id, Eq id) => record -> ((?viewContext :: viewContext, ?formContext :: FormContext record) => Html) -> Html Source #

createFormContext :: forall record viewContext parent id application. (?viewContext :: viewContext, Eq record, Typeable record, HasField "id" record id, application ~ ViewApp viewContext, HasField "meta" record MetaBag) => record -> FormContext record Source #

buildForm :: forall model viewContext parent id. (?viewContext :: viewContext, HasField "id" model id, Default id, Eq id) => FormContext model -> ((?viewContext :: viewContext, ?formContext :: FormContext model) => Html) -> Html Source #

submitButton :: forall model id. (?formContext :: FormContext model, HasField "id" model id, KnownSymbol (GetModelName model), Eq id, Default id) => SubmitButton Source #

renderHelpText :: FormField -> MarkupM () Source #

textField :: forall fieldName model value. (?formContext :: FormContext model, HasField fieldName model value, HasField "meta" model MetaBag, KnownSymbol fieldName, InputValue value, KnownSymbol (GetModelName model)) => Proxy fieldName -> FormField Source #

numberField :: forall fieldName model value. (?formContext :: FormContext model, HasField fieldName model value, HasField "meta" model MetaBag, KnownSymbol fieldName, InputValue value, KnownSymbol (GetModelName model)) => Proxy fieldName -> FormField Source #

textareaField :: forall fieldName model value. (?formContext :: FormContext model, HasField fieldName model value, HasField "meta" model MetaBag, KnownSymbol fieldName, InputValue value, KnownSymbol (GetModelName model)) => Proxy fieldName -> FormField Source #

colorField :: forall fieldName model value. (?formContext :: FormContext model, HasField fieldName model value, HasField "meta" model MetaBag, KnownSymbol fieldName, InputValue value, KnownSymbol (GetModelName model)) => Proxy fieldName -> FormField Source #

emailField :: forall fieldName model. (?formContext :: FormContext model, HasField fieldName model Text, HasField "meta" model MetaBag, KnownSymbol fieldName, KnownSymbol (GetModelName model)) => Proxy fieldName -> FormField Source #

dateField :: forall fieldName model value. (?formContext :: FormContext model, HasField fieldName model value, HasField "meta" model MetaBag, KnownSymbol fieldName, InputValue value, KnownSymbol (GetModelName model)) => Proxy fieldName -> FormField Source #

passwordField :: forall fieldName model. (?formContext :: FormContext model, HasField fieldName model Text, HasField "meta" model MetaBag, KnownSymbol fieldName, KnownSymbol (GetModelName model)) => Proxy fieldName -> FormField Source #

dateTimeField :: forall fieldName model value. (?formContext :: FormContext model, HasField fieldName model value, HasField "meta" model MetaBag, KnownSymbol fieldName, InputValue value, KnownSymbol (GetModelName model)) => Proxy fieldName -> FormField Source #

hiddenField :: forall fieldName model value. (?formContext :: FormContext model, HasField fieldName model value, HasField "meta" model MetaBag, KnownSymbol fieldName, InputValue value, KnownSymbol (GetModelName model)) => Proxy fieldName -> FormField Source #

checkboxField :: forall fieldName model. (?formContext :: FormContext model, HasField fieldName model Bool, HasField "meta" model MetaBag, KnownSymbol fieldName, KnownSymbol (GetModelName model)) => Proxy fieldName -> FormField Source #

selectField :: forall fieldName model item. (?formContext :: FormContext model, HasField fieldName model (SelectValue item), HasField "meta" model MetaBag, KnownSymbol fieldName, KnownSymbol (GetModelName model), CanSelect item, InputValue (SelectValue item)) => Proxy fieldName -> [item] -> FormField Source #

class CanSelect model where Source #

Minimal complete definition

Nothing

Associated Types

type SelectValue model :: Type Source #

Methods

selectLabel :: model -> Text Source #

default selectLabel :: Show model => model -> Text Source #

selectValue :: model -> SelectValue model Source #

default selectValue :: HasField "id" model (SelectValue model) => model -> SelectValue model Source #