Hi,
I see now the problem. HstRequest is directly used in FormUtils to read
the parameter.
However, I think you can use the following method instead:
org.hippoecm.hst.component.support.forms.FormUtils#populate(HttpServletRequest,
FormMap);
So, instead of passing HstRequest instance, if you pass the container
request, then it might work:
FormUtils.populate(RequestContextProvider.get().getServletRequest(),
formMap);
Could you try this?
Thanks,
Woonsan
> Maybe I'm wrong, but stepping through FormUtils.populateFormMap(...), it
> is unable to retrieve the UUID parameter from the request
> (request.getParameter(DEFAULT_UUID_NAME) )
>
> Stepping furthing into the code, the HstRequestImpl.getParameter(String
> name) delegates the retrieval of the parameter to
> getParameterMap().get(String)and the getParameterMap() method is what
> uses the reference namespace.
>
> Admittedly I can retrieve the repository node that holds the form data
> using the UUID but how then can I populate the formMap?
>
> Thanks
>
> On Tuesday, October 21, 2014 10:12:56 AM UTC+1, t.jeger wrote:
>
> you say "due to the namespaces differing [...]". What makes you
> think that the problem is there? I'd expect that the UUID (which is
> unique in your repository, and hence also unique in your /formdata
> store) is sufficient to retrieve the form data.
>
> cheers
>
> Tobi
>
> On Tue, Oct 21, 2014 at 10:19 AM, <
riaz...@gmail.com <javascript:>>
> wrote:
>
> Hi Woonsan,
>
> Thank you for responding so quickly.
>
> I'm not sure that your approach will work due to the fact that
> within doAction method of the RegisterComponent I'm using
> FormUtils.persistFormMap to temporarily save the form. Then from
> the doRender method of the SurveyComponent I'm using
> FormUtils.populateFormMap to retrieve the form. However, due to
> the namespaces differing, the formMap isn't populated as the
> UUID cannot be resolved.
>
> On Monday, October 20, 2014 4:16:24 PM UTC+1, w.ko wrote:
>
> On 10/20/14 10:52 AM,
riaz...@gmail.com wrote:
> > Hi Tobi,
> >
> > Thanks for the quick response. Do you mean turn off the
> parameter
> > name-spacing?
>
> You don't have to turn it off.
> In you case, you can read it by invoking the following
> method after
> sending it without namespace reference prefix (see my other
> reply):
>
> org.hippoecm.hst.component.__support.bean.BaseHstComponent#__getPublicRequestParameter(__HstRequest,
> to"/site/survey?"+request.__getReferenceNamespace()+":"+__FormUtils.DEFAULT_UUID_NAME+"=__"+UUID
>
> > so that it has the expected path with the form UUID.
> >
> > Now when the redirect occurs, the UUID fails to
> resolve as the
> > reference namespace returned from
> > request.getReferenceNamespace(__) is different to
> the one that is
> > passed in the URL. I'm assuming this is due to the
> use of
> > different components.
> >
> > So my question is what is the correct way to
> submit a form that
> > redirects to a different sitemapitem that
> references a different
> > page that uses a different component such that the
> form can be
> > retrieved?
> >
> > Thanks
> >
> > --
> > Hippo Community Group: The place for all
> discussions and
> > announcements about Hippo CMS (and HST, repository
> etc. etc.)
> >
> > To post to this group, send email to
>
hippo-c...@googlegroups.com
> > <javascript:>
> > RSS:
> >
>
https://groups.google.com/__group/hippo-community/feed/__rss_v2_0_msgs.xml?num=50
> <
https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50>
>
> >
> <
https://groups.google.com/__group/hippo-community/feed/__rss_v2_0_msgs.xml?num=50
> hippo-communi...@googlegroups.__com
> > <javascript:>.
> > Visit this group at
> >
http://groups.google.com/__group/hippo-community
> <
http://groups.google.com/group/hippo-community>
> > <
http://groups.google.com/__group/hippo-community
>
https://groups.google.com/d/__optout
> <
https://groups.google.com/d/optout>
> > <
https://groups.google.com/d/__optout
> hippo-c...@googlegroups.__com
> > RSS:
> >
https://groups.google.com/__group/hippo-community/feed/__rss_v2_0_msgs.xml?num=50
> > an email to hippo-communi...@__
googlegroups.com
> > <mailto:
hippo-communit...@googlegroups.com>.
> > Visit this group at
http://groups.google.com/__group/hippo-community
> <
http://groups.google.com/group/hippo-community>.
> > For more options, visit
https://groups.google.com/d/__optout
> <
https://groups.google.com/d/optout>.
>
>
> --
>
w....@onehippo.com www.onehippo.com
> <
http://www.onehippo.com>
> Boston - 101 Main Street, Cambridge, MA 02142
> Amsterdam - Oosteinde 11, 1017 WT Amsterdam
> US
+1 877 414 4776 (toll free)
> Europe
+31(0)20 522 4466
>
> --
> Hippo Community Group: The place for all discussions and
> announcements about Hippo CMS (and HST, repository etc. etc.)
>
> To post to this group, send email to
hippo-c...@googlegroups.com
> <mailto:
hippo-communi...@googlegroups.com>.