ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Gray <scott.g...@hotwaxmedia.com>
Subject Re: FreeMarker requestAttribute issue
Date Wed, 04 May 2011 12:49:30 GMT
You need to put it in the screen context and not in the request attributes, if you're using
groovy then it's just:
context.surveyWrapper = surveyWrapper

Reason being that the request attributes (and session attributes and parameters) have already
been placed in the context at the start of the screen rendering and your actions are occurring
after that point.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 4/05/2011, at 9:55 PM, Justin Robinson wrote:

> surveyWrapper?has_content always returns false no matter that the
> debug shows that it's not null when it's set.
> Have tried setting it as a session attribute, with no effect.
> Am really stumped on this one no idea what to try....Any ideas?
> 
> 
> the ftl:
> <div class="screenlet">
>    <div class="screenlet-body">
>        <#-- Render the survey -->
>        <#if surveyWrapper?has_content>
>            <form method="post" enctype="multipart/form-data"
> action="<@ofbizUrl>profilesurvey/profilesurvey</@ofbizUrl>"
> style="margin: 0;">
>              ${surveyWrapper.render()}
>            </form>
>        <#else>
>            <h1>Survey Failed</h1>
>            <p>surveyWrapper?has_content returned false</p>
>        </#if>
>    </div>
> </div>
> 
> code that sets the surveyWrapper:
> // set up a surveyAction and surveyWrapper, then redirect to survey
> ProductStoreSurveyWrapper wrapper = new
> ProductStoreSurveyWrapper(surveys.get(0), cart.getOrderPartyId(),
> UtilHttp.getParameterMap(request));
> Debug.log("wrapper: "+(wrapper!=null? "not null":"null"), MODULE);
> request.setAttribute("surveyWrapper", wrapper);
> request.getSession().setAttribute("surveyWrapper", wrapper);
> request.setAttribute("surveyAction", "addOrderItemSurvey")
> 
> Regards,
> Justin
> Venture-Net Research & Development


Mime
View raw message