Safe HaskellNone

IHP.View.Form

Documentation

class ModelFormAction application record where Source #

Methods

modelFormAction :: (?context :: ControllerContext) => record -> Text Source #

Instances

Instances details
(HasField "id" record id, Eq id, Default id, KnownSymbol (GetModelName record), Show id) => ModelFormAction application record Source #

Returns the form's action attribute for a given record.

Expects that AutoRoute is used. Otherwise you need to use formFor' or specify a manual ModelFormAction instance.

We guess the form submitt action based on the current url It's a New..Action or Edit..Action. We guess the corresponding Create..Action name or Update..Action name based on the AutoRoute rules

In case the routing is not based on AutoRoute, a manual ModelFormAction instance needs to be defined

Instance details

Defined in IHP.View.Form

Methods

modelFormAction :: record -> Text Source #

formFor :: forall record parent id application. (?context :: ControllerContext, Eq record, Typeable record, ModelFormAction application record, HasField "id" record id, HasField "meta" record MetaBag, Default id, Eq id) => record -> ((?context :: ControllerContext, ?formContext :: FormContext record) => Html) -> Html Source #

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

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

buildForm :: forall model parent id. (?context :: ControllerContext, HasField "id" model id, Default id, Eq id) => FormContext model -> ((?context :: ControllerContext, ?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 #

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 #

Orphan instances

ToHtml SubmitButton Source # 
Instance details

Methods

toHtml :: SubmitButton -> Html Source #

ToHtml FormField Source # 
Instance details

Methods

toHtml :: FormField -> Html Source #