[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haskell-cafe
Subject:    Re: [Haskell-cafe] Fwd: web-routes and forms
From:       Corentin Dupont <corentin.dupont () gmail ! com>
Date:       2011-01-29 21:33:35
Message-ID: AANLkTimO3chgP0vDenjQUsHB6b1LZcy4NHs52ux3oZLD () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thanks!!!!

On Sat, Jan 29, 2011 at 11:33 AM, Jasper Van der Jeugt
<jaspervdj@gmail.com>wrote:

> Hello,
>
> I've backported the `inputHidden` combinator to the 0.0.2 branch, you
> can find it on hackage as digestive-functors-blaze-0.0.2.2.
>
> Hope this helps,
> Cheers,
> Jasper
>
> On Fri, Jan 28, 2011 at 8:10 PM, Corentin Dupont
> <corentin.dupont@gmail.com> wrote:
> > Hello again,
> > is there a way to had a "hidden" field in digestive-functor-blaze?
> > I'm using it to transmit some data...
> > Thanks,
> > Corentin
> >
> > On Thu, Jan 27, 2011 at 11:21 AM, Corentin Dupont
> > <corentin.dupont@gmail.com> wrote:
> >>
> >> OK thanks, now it's clear!
> >>
> >> On Thu, Jan 27, 2011 at 11:13 AM, Jasper Van der Jeugt
> >> <jaspervdj@gmail.com> wrote:
> >>>
> >>> Hello,
> >>>
> >>> As Jeremy said, the HTML returned by formHtml is meant to be placed
> >>> inside the a <form> tag: it does not include a <form> tag. You should
> >>> use it like this:
> >>>
> >>> >             H.form ! A.enctype (H.stringValue $ show enctype)
> >>> >                    ! A.method "POST" ! A.action "/" $ do
> >>> >                 html  -- The HTML rendered by formHtml
> >>> >                 H.input ! A.type_ "submit" ! A.value "Submit"
> >>>
> >>> (with or without the submit button).
> >>>
> >>> Cheers,
> >>> Jasper
> >>>
> >>> On Jan 27, 2011 10:54 AM, "Corentin Dupont" <corentin.dupont@gmail.com
> >
> >>> wrote:
> >>> > Hello Jasper,
> >>> > Do you have an idea?
> >>> >
> >>> > Thanks,
> >>> > Corentin
> >>> >
> >>> > ---------- Forwarded message ----------
> >>> > From: Jeremy Shaw <jeremy@n-heptane.com>
> >>> > Date: Thu, Jan 27, 2011 at 2:22 AM
> >>> > Subject: Re: web-routes and forms
> >>> > To: Corentin Dupont <corentin.dupont@gmail.com>
> >>> > Cc: haskell <haskell-cafe@haskell.org>
> >>> >
> >>> >
> >>> > On Wed, Jan 26, 2011 at 4:33 PM, Corentin Dupont
> >>> > <corentin.dupont@gmail.com> wrote:
> >>> >
> >>> >> Now turning to digestive functors, I don't see where do goes the
> >>> >> "A.action
> >>> >> actionURL" part that was in traditionnal forms?
> >>> >> It seems I need it for routing the result of the form.
> >>> >
> >>> > I think you will find formHtml is returning you the stuff that goes
> >>> > inside the <form> tag, but does not actually include the form tag
> >>> > itself ?
> >>> >
> >>> > I am not sure how to modify the attrs using blaze-html. I think that
> >>> > is a missing feature of the digestive-functors-blaze package. In
> >>> > digestive-functors-hsp there is a function:
> >>> >
> >>> >
> >>> > setAttrs :: (EmbedAsAttr x attr, XMLGenerator x, Monad m, Functor m)
> =>
> >>> > Form m i e [HSX.GenXML x] a
> >>> > -> attr
> >>> > -> Form m i e [HSX.GenXML x] a
> >>> > setAttrs form attrs = mapView (map (`set` attrs)) form
> >>> >
> >>> >
> >>> > You probably need something similar for blaze.
> >>> >
> >>> > - jeremy
> >>
> >
> >
>

[Attachment #5 (text/html)]

Thanks!!!!<br><br><div class="gmail_quote">On Sat, Jan 29, 2011 at 11:33 AM, Jasper \
Van der Jeugt <span dir="ltr">&lt;<a \
href="mailto:jaspervdj@gmail.com">jaspervdj@gmail.com</a>&gt;</span> \
wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; \
border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> Hello,<br>
<br>
I&#39;ve backported the `inputHidden` combinator to the 0.0.2 branch, you<br>
can find it on hackage as digestive-functors-blaze-0.0.2.2.<br>
<br>
Hope this helps,<br>
Cheers,<br>
Jasper<br>
<br>
On Fri, Jan 28, 2011 at 8:10 PM, Corentin Dupont<br>
<div><div></div><div class="h5">&lt;<a \
href="mailto:corentin.dupont@gmail.com">corentin.dupont@gmail.com</a>&gt; wrote:<br> \
&gt; Hello again,<br> &gt; is there a way to had a &quot;hidden&quot; field in \
digestive-functor-blaze?<br> &gt; I&#39;m using it to transmit some data...<br>
&gt; Thanks,<br>
&gt; Corentin<br>
&gt;<br>
&gt; On Thu, Jan 27, 2011 at 11:21 AM, Corentin Dupont<br>
&gt; &lt;<a href="mailto:corentin.dupont@gmail.com">corentin.dupont@gmail.com</a>&gt; \
wrote:<br> &gt;&gt;<br>
&gt;&gt; OK thanks, now it&#39;s clear!<br>
&gt;&gt;<br>
&gt;&gt; On Thu, Jan 27, 2011 at 11:13 AM, Jasper Van der Jeugt<br>
&gt;&gt; &lt;<a href="mailto:jaspervdj@gmail.com">jaspervdj@gmail.com</a>&gt; \
wrote:<br> &gt;&gt;&gt;<br>
&gt;&gt;&gt; Hello,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; As Jeremy said, the HTML returned by formHtml is meant to be placed<br>
&gt;&gt;&gt; inside the a &lt;form&gt; tag: it does not include a &lt;form&gt; tag. \
You should<br> &gt;&gt;&gt; use it like this:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; &gt;             H.form ! A.enctype (H.stringValue $ show enctype)<br>
&gt;&gt;&gt; &gt;                    ! A.method &quot;POST&quot; ! A.action \
&quot;/&quot; $ do<br> &gt;&gt;&gt; &gt;                 html  -- The HTML rendered \
by formHtml<br> &gt;&gt;&gt; &gt;                 H.input ! A.type_ \
&quot;submit&quot; ! A.value &quot;Submit&quot;<br> &gt;&gt;&gt;<br>
&gt;&gt;&gt; (with or without the submit button).<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Cheers,<br>
&gt;&gt;&gt; Jasper<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Jan 27, 2011 10:54 AM, &quot;Corentin Dupont&quot; &lt;<a \
href="mailto:corentin.dupont@gmail.com">corentin.dupont@gmail.com</a>&gt;<br> \
&gt;&gt;&gt; wrote:<br> &gt;&gt;&gt; &gt; Hello Jasper,<br>
&gt;&gt;&gt; &gt; Do you have an idea?<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Thanks,<br>
&gt;&gt;&gt; &gt; Corentin<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; ---------- Forwarded message ----------<br>
&gt;&gt;&gt; &gt; From: Jeremy Shaw &lt;<a \
href="mailto:jeremy@n-heptane.com">jeremy@n-heptane.com</a>&gt;<br> &gt;&gt;&gt; &gt; \
Date: Thu, Jan 27, 2011 at 2:22 AM<br> &gt;&gt;&gt; &gt; Subject: Re: web-routes and \
forms<br> &gt;&gt;&gt; &gt; To: Corentin Dupont &lt;<a \
href="mailto:corentin.dupont@gmail.com">corentin.dupont@gmail.com</a>&gt;<br> \
&gt;&gt;&gt; &gt; Cc: haskell &lt;<a \
href="mailto:haskell-cafe@haskell.org">haskell-cafe@haskell.org</a>&gt;<br> \
&gt;&gt;&gt; &gt;<br> &gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; On Wed, Jan 26, 2011 at 4:33 PM, Corentin Dupont<br>
&gt;&gt;&gt; &gt; &lt;<a \
href="mailto:corentin.dupont@gmail.com">corentin.dupont@gmail.com</a>&gt; wrote:<br> \
&gt;&gt;&gt; &gt;<br> &gt;&gt;&gt; &gt;&gt; Now turning to digestive functors, I \
don&#39;t see where do goes the<br> &gt;&gt;&gt; &gt;&gt; &quot;A.action<br>
&gt;&gt;&gt; &gt;&gt; actionURL&quot; part that was in traditionnal forms?<br>
&gt;&gt;&gt; &gt;&gt; It seems I need it for routing the result of the form.<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; I think you will find formHtml is returning you the stuff that \
goes<br> &gt;&gt;&gt; &gt; inside the &lt;form&gt; tag, but does not actually include \
the form tag<br> &gt;&gt;&gt; &gt; itself ?<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; I am not sure how to modify the attrs using blaze-html. I think \
that<br> &gt;&gt;&gt; &gt; is a missing feature of the digestive-functors-blaze \
package. In<br> &gt;&gt;&gt; &gt; digestive-functors-hsp there is a function:<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; setAttrs :: (EmbedAsAttr x attr, XMLGenerator x, Monad m, Functor \
m) =&gt;<br> &gt;&gt;&gt; &gt; Form m i e [HSX.GenXML x] a<br>
&gt;&gt;&gt; &gt; -&gt; attr<br>
&gt;&gt;&gt; &gt; -&gt; Form m i e [HSX.GenXML x] a<br>
&gt;&gt;&gt; &gt; setAttrs form attrs = mapView (map (`set` attrs)) form<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; You probably need something similar for blaze.<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; - jeremy<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
</div></div></blockquote></div><br>



_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic