Accessing context in htmlScreenMactoLibrary templates macros

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Accessing context in htmlScreenMactoLibrary templates macros

Bruno Busco
Hi Devs!
Is there a way to access the context in the template macros that are defined
in the htmlScreenMacroLibrary.ftl file?

I mean, as far as I can see, all widget templates defined in
htmlScreenMacroLibrary.ftl only access variables that are passed as macro
parameters.
How can I access something different like <@ofbizUrl> or
${setRequestAttribute("portalPageId", portalPageId)}?.

Thank you for any help on this.
What I am trying to do is to proceed with
https://issues.apache.org/jira/browse/OFBIZ-3625

-Bruno
Reply | Threaded
Open this post in threaded view
|

Re: Accessing context in htmlScreenMactoLibrary templates macros

Scott Gray-2
Hi Bruno,

Macros only have access to the parameters that are passed in.

Have you considered only handling the html portion in the macro and doing the screen render in the renderer?

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 3/04/2010, at 9:11 AM, Bruno Busco wrote:

> Hi Devs!
> Is there a way to access the context in the template macros that are defined
> in the htmlScreenMacroLibrary.ftl file?
>
> I mean, as far as I can see, all widget templates defined in
> htmlScreenMacroLibrary.ftl only access variables that are passed as macro
> parameters.
> How can I access something different like <@ofbizUrl> or
> ${setRequestAttribute("portalPageId", portalPageId)}?.
>
> Thank you for any help on this.
> What I am trying to do is to proceed with
> https://issues.apache.org/jira/browse/OFBIZ-3625
>
> -Bruno


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Accessing context in htmlScreenMactoLibrary templates macros

Bruno Busco
Thank you Scott.
You are right! I should move more things in the renderer and have only the
html in the macro.
-Bruno


2010/4/3 Scott Gray <[hidden email]>

> Hi Bruno,
>
> Macros only have access to the parameters that are passed in.
>
> Have you considered only handling the html portion in the macro and doing
> the screen render in the renderer?
>
> Regards
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
> On 3/04/2010, at 9:11 AM, Bruno Busco wrote:
>
> > Hi Devs!
> > Is there a way to access the context in the template macros that are
> defined
> > in the htmlScreenMacroLibrary.ftl file?
> >
> > I mean, as far as I can see, all widget templates defined in
> > htmlScreenMacroLibrary.ftl only access variables that are passed as macro
> > parameters.
> > How can I access something different like <@ofbizUrl> or
> > ${setRequestAttribute("portalPageId", portalPageId)}?.
> >
> > Thank you for any help on this.
> > What I am trying to do is to proceed with
> > https://issues.apache.org/jira/browse/OFBIZ-3625
> >
> > -Bruno
>
>