[Hippo-cms7-user] Forms

Jeroen Reijn j.reijn at onehippo.com
Mon Oct 10 11:21:49 CEST 2011


Hi,

for the doAction method to be called you will need to use the
<hst:actionURL/> tag.
Try:

<hst:actionURL var="actionUrl"/>
<form action="${actionUrl}" method="post">

Cheers,

Jeroen

On Mon, Oct 10, 2011 at 11:01 AM, d.clayton <d.clayton at lukkien.com> wrote:
> After adding a refId on my sitemap I at least managed to get my form to post
> to my component. Here's the code:
>
> In JSP:
>
> <div class="grower">
>        <hst:link var="form" siteMapItemRefId="registerId" />
>        <form action="${form}" method="post">
>        Username: <input name="username"> <input type="submit">
>        </form>
> </div>
>
> In Java component:
>
> public class Register extends BaseFormHstComponent{
>    @Override
>    public void doAction(HstRequest request, HstResponse response) {
>        System.out.println("ACTION");
>        FormMap map = new FormMap(request, new String[]{"username"});
>        persistFormMap(request, response, map, null);
>    }
>
>    @Override
>    public void doBeforeRender( HstRequest request, HstResponse response)  {
>        System.out.println("BEFORE RENDER (GET)");
>        FormMap map = new FormMap();
>        populate(request, map);
>    }
> }
>
> Now, ACTION is never output, so doAction is not called by the POST of the
> form. I really am at a loss here.
>
> --
> View this message in context: http://hippo.2275632.n2.nabble.com/Forms-tp6876115p6876249.html
> Sent from the Hippo CMS 7 mailing list archive at Nabble.com.
> _______________________________________________
> Hippo-cms7-user mailing list and forums
> http://www.onehippo.org/cms7/support/forums.html
>



-- 
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
Boston - 1 Broadway, Cambridge, MA 02142

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com



More information about the Hippo-cms7-user mailing list