dispatcher.runSync() in FTL file question

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

dispatcher.runSync() in FTL file question

Adrian Crum
I'm trying to execute the following statement in an FTL file:

<#assign testPrefMap = dispatcher.runSync("getUserPreferenceGroup",
Static["org.ofbiz.base.util.UtilMisc"].toMap("userPrefGroupId",
"EXAMPLE_APP_DEMO_SCREEN"))/>

but I keep getting exceptions thrown that basically boil down to there being no
userLogin entity in the context when the service is invoked.

What am I doing wrong?
Reply | Threaded
Open this post in threaded view
|

Re: dispatcher.runSync() in FTL file question

cjhowe
#assign testPrefMap
=dispatcher.runSync("getUserPreferenceGroup",
Static["org.ofbiz.base.util.UtilMisc"].toMap("userPrefGroupId",
"EXAMPLE_APP_DEMO_SCREEN", "userLogin", userLogin))/>

--- Adrian Crum <[hidden email]> wrote:

> I'm trying to execute the following statement in an
> FTL file:
>
> <#assign testPrefMap =
> dispatcher.runSync("getUserPreferenceGroup",
>
Static["org.ofbiz.base.util.UtilMisc"].toMap("userPrefGroupId",

>
> "EXAMPLE_APP_DEMO_SCREEN"))/>
>
> but I keep getting exceptions thrown that basically
> boil down to there being no
> userLogin entity in the context when the service is
> invoked.
>
> What am I doing wrong?
>

Reply | Threaded
Open this post in threaded view
|

Re: dispatcher.runSync() in FTL file question

Andrew Zeneski
In reply to this post by Adrian Crum
You will need to manually place the userLogin object into the context.
This object *should* be available to the FTL file, so add:

Static["org.ofbiz.base.util.UtilMisc"].toMap("userPrefGroupId",
"EXAMPLE_APP_DEMO_SCREEN", "userLogin", userLogin)

Andy

Adrian Crum wrote:

> I'm trying to execute the following statement in an FTL file:
>
> <#assign testPrefMap = dispatcher.runSync("getUserPreferenceGroup",
> Static["org.ofbiz.base.util.UtilMisc"].toMap("userPrefGroupId",
> "EXAMPLE_APP_DEMO_SCREEN"))/>
>
> but I keep getting exceptions thrown that basically boil down to there
> being no userLogin entity in the context when the service is invoked.
>
> What am I doing wrong?

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

Re: dispatcher.runSync() in FTL file question

Adrian Crum
In reply to this post by cjhowe
Thanks Chris!

Chris Howe wrote:

> #assign testPrefMap
> =dispatcher.runSync("getUserPreferenceGroup",
> Static["org.ofbiz.base.util.UtilMisc"].toMap("userPrefGroupId",
> "EXAMPLE_APP_DEMO_SCREEN", "userLogin", userLogin))/>
>
> --- Adrian Crum <[hidden email]> wrote:
>
>
>>I'm trying to execute the following statement in an
>>FTL file:
>>
>><#assign testPrefMap =
>>dispatcher.runSync("getUserPreferenceGroup",
>>
>
> Static["org.ofbiz.base.util.UtilMisc"].toMap("userPrefGroupId",
>
>>"EXAMPLE_APP_DEMO_SCREEN"))/>
>>
>>but I keep getting exceptions thrown that basically
>>boil down to there being no
>>userLogin entity in the context when the service is
>>invoked.
>>
>>What am I doing wrong?
>>
>
>
>