You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by William Perng <wp...@salmonllc.com> on 2007/08/08 22:26:58 UTC

sessionAttributes in screen widget

I put the partyId in session attribute, however, I am not able to use the
following code to retrieve it in screen widget.   <set field="partyId"
from-field="sessionAttributes.partyId"/>  It works fine, if I put my partyId
in url and use parameters.partyId to read it.  Could anyone please help ?

Thanks

William Perng
wperng@salmonllc.com  




RE: sessionAttributes in screen widget

Posted by William Perng <wp...@salmonllc.com>.
Thanks to David and Amine.  It works.  I should use  <set field="partyId"
from-field="parameters.partyId"/>.  

William 

-----Original Message-----
From: David E Jones [mailto:jonesde@hotwaxmedia.com] 
Sent: Wednesday, August 08, 2007 5:08 PM
To: user@ofbiz.apache.org
Subject: Re: sessionAttributes in screen widget


Oh, BTW, sessionAttributes.partyId should get that attribute out if it
exists.

You can also try doing a label with ${sessionAttributes} in the widgets or
in your FTL file to see what is in the session.

-David


David E Jones wrote:
> 
> Not sure where you got that idea... If anyone said it on the mailing 
> lists they were wrong.
> 
> Check out the UtilHttp.getCombinedMap(HttpServletRequest request, Set
> namesToSkip) method.
> 
> -David
> 
> 
> William Perng wrote:
>> I am not sure I understand ofbiz correctly.  Please correct me, if I 
>> am wrong.  I thought if I want to put the partyId in parameters Map, 
>> it has to be in the url.  The ofbiz will automatically populate those 
>> parameters in url to parameters map.  In our customized application, 
>> we need keep the partyId in session, since our page content will 
>> change base one this partyId in session attribute.
>>
>>
>> -----Original Message-----
>> From: Adrian Crum [mailto:adrianc@hlmksw.com] Sent: Wednesday, August 
>> 08, 2007 4:30 PM
>> To: user@ofbiz.apache.org
>> Subject: Re: sessionAttributes in screen widget
>>
>> Why not just put the partyId in the parameters Map?
>>
>> William Perng wrote:
>>
>>> I put the partyId in session attribute, however, I am not able to use 
>>> the
>>> following code to retrieve it in screen widget.   <set field="partyId"
>>> from-field="sessionAttributes.partyId"/>  It works fine, if I put my 
>>> partyId in url and use parameters.partyId to read it.  Could anyone 
>>> please
>> help ?
>>> Thanks
>>>
>>> William Perng
>>> wperng@salmonllc.com
>>>
>>>
>>>
>>>
>>
>>
>>




Re: sessionAttributes in screen widget

Posted by David E Jones <jo...@hotwaxmedia.com>.
Oh, BTW, sessionAttributes.partyId should get that attribute out if it exists.

You can also try doing a label with ${sessionAttributes} in the widgets or in your FTL file to see what is in the session.

-David


David E Jones wrote:
> 
> Not sure where you got that idea... If anyone said it on the mailing 
> lists they were wrong.
> 
> Check out the UtilHttp.getCombinedMap(HttpServletRequest request, Set 
> namesToSkip) method.
> 
> -David
> 
> 
> William Perng wrote:
>> I am not sure I understand ofbiz correctly.  Please correct me, if I am
>> wrong.  I thought if I want to put the partyId in parameters Map, it 
>> has to
>> be in the url.  The ofbiz will automatically populate those parameters in
>> url to parameters map.  In our customized application, we need keep the
>> partyId in session, since our page content will change base one this 
>> partyId
>> in session attribute.
>>
>>
>> -----Original Message-----
>> From: Adrian Crum [mailto:adrianc@hlmksw.com] Sent: Wednesday, August 
>> 08, 2007 4:30 PM
>> To: user@ofbiz.apache.org
>> Subject: Re: sessionAttributes in screen widget
>>
>> Why not just put the partyId in the parameters Map?
>>
>> William Perng wrote:
>>
>>> I put the partyId in session attribute, however, I am not able to use 
>>> the
>>> following code to retrieve it in screen widget.   <set field="partyId"
>>> from-field="sessionAttributes.partyId"/>  It works fine, if I put my 
>>> partyId in url and use parameters.partyId to read it.  Could anyone 
>>> please
>> help ?
>>> Thanks
>>>
>>> William Perng
>>> wperng@salmonllc.com
>>>
>>>
>>>
>>>
>>
>>
>>

Re: sessionAttributes in screen widget

Posted by David E Jones <jo...@hotwaxmedia.com>.
Not sure where you got that idea... If anyone said it on the mailing lists they were wrong.

Check out the UtilHttp.getCombinedMap(HttpServletRequest request, Set namesToSkip) method.

-David


William Perng wrote:
> I am not sure I understand ofbiz correctly.  Please correct me, if I am
> wrong.  I thought if I want to put the partyId in parameters Map, it has to
> be in the url.  The ofbiz will automatically populate those parameters in
> url to parameters map.  In our customized application, we need keep the
> partyId in session, since our page content will change base one this partyId
> in session attribute.
> 
> 
> -----Original Message-----
> From: Adrian Crum [mailto:adrianc@hlmksw.com] 
> Sent: Wednesday, August 08, 2007 4:30 PM
> To: user@ofbiz.apache.org
> Subject: Re: sessionAttributes in screen widget
> 
> Why not just put the partyId in the parameters Map?
> 
> William Perng wrote:
> 
>> I put the partyId in session attribute, however, I am not able to use the
>> following code to retrieve it in screen widget.   <set field="partyId"
>> from-field="sessionAttributes.partyId"/>  It works fine, if I put my 
>> partyId in url and use parameters.partyId to read it.  Could anyone please
> help ?
>> Thanks
>>
>> William Perng
>> wperng@salmonllc.com
>>
>>
>>
>>
> 
> 
> 

Re: sessionAttributes in screen widget

Posted by Adrian Crum <ad...@hlmksw.com>.
The parameters Map does contain the url parameters - as well as context parameters set in the 
web.xml file and parameters set in scripts and <actions> elements in screen widgets.

So...

In web.xml:

<context-param>
   <param-name>myParameter</param-name>
   <param-value>Hello World</param-value>
</context-param>

In bsh script:

parameters.put("myParameter", "Hello World");

In screen widget:

<actions>
   <set field="parameters.myParameter" value="Hello World"/>
</actions>


William Perng wrote:

> I am not sure I understand ofbiz correctly.  Please correct me, if I am
> wrong.  I thought if I want to put the partyId in parameters Map, it has to
> be in the url.  The ofbiz will automatically populate those parameters in
> url to parameters map.  In our customized application, we need keep the
> partyId in session, since our page content will change base one this partyId
> in session attribute.
> 
> 
> -----Original Message-----
> From: Adrian Crum [mailto:adrianc@hlmksw.com] 
> Sent: Wednesday, August 08, 2007 4:30 PM
> To: user@ofbiz.apache.org
> Subject: Re: sessionAttributes in screen widget
> 
> Why not just put the partyId in the parameters Map?
> 
> William Perng wrote:
> 
> 
>>I put the partyId in session attribute, however, I am not able to use the
>>following code to retrieve it in screen widget.   <set field="partyId"
>>from-field="sessionAttributes.partyId"/>  It works fine, if I put my 
>>partyId in url and use parameters.partyId to read it.  Could anyone please
> 
> help ?
> 
>>Thanks
>>
>>William Perng
>>wperng@salmonllc.com
>>
>>
>>
>>
> 
> 
> 
> 
> 

RE: sessionAttributes in screen widget

Posted by William Perng <wp...@salmonllc.com>.
I am not sure I understand ofbiz correctly.  Please correct me, if I am
wrong.  I thought if I want to put the partyId in parameters Map, it has to
be in the url.  The ofbiz will automatically populate those parameters in
url to parameters map.  In our customized application, we need keep the
partyId in session, since our page content will change base one this partyId
in session attribute.


-----Original Message-----
From: Adrian Crum [mailto:adrianc@hlmksw.com] 
Sent: Wednesday, August 08, 2007 4:30 PM
To: user@ofbiz.apache.org
Subject: Re: sessionAttributes in screen widget

Why not just put the partyId in the parameters Map?

William Perng wrote:

> I put the partyId in session attribute, however, I am not able to use the
> following code to retrieve it in screen widget.   <set field="partyId"
> from-field="sessionAttributes.partyId"/>  It works fine, if I put my 
> partyId in url and use parameters.partyId to read it.  Could anyone please
help ?
> 
> Thanks
> 
> William Perng
> wperng@salmonllc.com
> 
> 
> 
> 




Re: sessionAttributes in screen widget

Posted by Adrian Crum <ad...@hlmksw.com>.
Why not just put the partyId in the parameters Map?

William Perng wrote:

> I put the partyId in session attribute, however, I am not able to use the
> following code to retrieve it in screen widget.   <set field="partyId"
> from-field="sessionAttributes.partyId"/>  It works fine, if I put my partyId
> in url and use parameters.partyId to read it.  Could anyone please help ?
> 
> Thanks
> 
> William Perng
> wperng@salmonllc.com  
> 
> 
> 
>