@hst.actionURL doAction Not firing

73 views
Skip to first unread message

bracki...@gmail.com

unread,
Sep 26, 2016, 5:16:54 PM9/26/16
to Hippo Community
We are having a problem understanding how the actionURL in the FTL relates to our component.  No matter what we try we cannot get the doAction mothod to fire.  We have a doBeforeRender method that does fire when the page gets rendered.

Here is the snippet from our ftl file.

            <@hst.actionURL var="actionLink" />
               <form id="quoteForm" name="Insurance_form" method="post" action="${actionLink}" enctype="application/x-www-form-urlencoded">

Here is the component code.

@ParametersInfo(type = LandingPageComponentInfo.class)
public class LandingPageComponent extends BaseHstComponent {
    @Override
    public void doBeforeRender(HstRequest request, HstResponse response) {
        super.doBeforeRender(request, response);

        LandingPageComponentInfo info = getComponentParametersInfo(request);

        HstRequestContext ctx = request.getRequestContext();
        HippoBean root = ctx.getSiteContentBaseBean();

        PageHeaderBanner headerBanner = root.getBean(info.getPageBanner(), PageHeaderBanner.class);
        PageStepsBanner stepsBanner = root.getBean(info.getStepsBanner(), PageStepsBanner.class);
        Promo promo1 = root.getBean(info.getPromo1(), Promo.class);
        Promo promo2 = root.getBean(info.getPromo2(), Promo.class);
        Disclaimer pageLinks = root.getBean(info.getPageLinks(), Disclaimer.class);
        Disclaimer disclaimer = root.getBean(info.getDisclaimer(), Disclaimer.class);
        Disclaimer formNumber = root.getBean(info.getFormNumber(), Disclaimer.class);
        PageLightBox learnMoreLightBox = root.getBean(info.getLearnMoreLightBox(), PageLightBox.class);
        PageLightBox learnAboutLightBox = root.getBean(info.getLearnAboutLightBox(), PageLightBox.class);

        request.setAttribute("headerBanner", headerBanner);
        request.setAttribute("stepsBanner", stepsBanner);
        request.setAttribute("promo1", promo1);
        request.setAttribute("promo2", promo2);
        request.setAttribute("pageLinks", pageLinks);
        request.setAttribute("disclaimer", disclaimer);
        request.setAttribute("formNumber", formNumber);
        request.setAttribute("learnMoreLightBox", learnMoreLightBox);
        request.setAttribute("learnAboutLightBox", learnAboutLightBox);
    }

    @Override
    public void doAction(HstRequest arg0, HstResponse arg1) throws HstComponentException {
        System.out.println("Hey you made it!!");

    }

Thanks

Woonsan Ko

unread,
Sep 26, 2016, 5:32:09 PM9/26/16
to hippo-c...@googlegroups.com
I'd like to recommend you to check two things:
i) Is the ftl template associated with the LandingPageComponent class in hst component or page configuration? Sometimes people mistake a ftl template of child component as parent component's template.
ii) Do you see if the action URL was fired through FireBug? The url should look like ...?_hn:type=action&_hn:ref=... in POST method.

Regards,

Woonsan


--
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-community@googlegroups.com
RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-community+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.



--
w....@onehippo.com     www.onehippo.com
Boston - 745 Atlantic Ave, 8th Floor, Boston MA 02111
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466

bracki...@gmail.com

unread,
Sep 27, 2016, 10:57:43 AM9/27/16
to Hippo Community

so for 
i)we think this is setup correctly we have a cataloge component that refrences both the template and the java component
II)we saw the url fired
To post to this group, send email to hippo-c...@googlegroups.com

RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.

Woonsan Ko

unread,
Sep 27, 2016, 11:02:29 AM9/27/16
to hippo-c...@googlegroups.com
On Tue, Sep 27, 2016 at 10:57 AM, <bracki...@gmail.com> wrote:

so for 
i)we think this is setup correctly we have a cataloge component that refrences both the template and the java component

Could you check one more if HstResponse#getNamespace() returns the same string in #doBeforeRender() of the component as the _hn:ref parameter string value?
Those two must be the same if the template was for the component correctly.

Regards,

Woonsan

 
To post to this group, send email to hippo-community@googlegroups.com

RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
---
You received this message because you are subscribed to the Google Groups "Hippo Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-community+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages