-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how can i change a value in a view? #121
Comments
I came across the exactly problem as yours, here 's my solution: import Text.Digestive.Types
import Text.Digestive.View
...
lform <- getForm "profile" (profileForm u')
let lform' = lform {viewInput = [
(toPath "email", TextInput $ sUserEmail user)
, (toPath "desc", TextInput $ sUserDesc user)
]}
... Not nice but do solve the problem, we should providing a helper to do this kind of things, for example, set some pre-defined values in views. |
thanks @winterland1989 this is workable |
@jaspervdj Do you think we should add some APIs to poke around view? |
Yes, I wouldn't mind having an API which allows you to set these values in a more convenient way. |
after using
postForm
, if there are form errors, i get aview
value. I cannot work out how to reset some of the form values held in the view before re-displaying the form. Specifically, my captcha should be regenerated with each request so as to prevent unlimited captcha attempts.The text was updated successfully, but these errors were encountered: