You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Amit Shinde <am...@amicontech.com> on 2006/12/02 01:04:14 UTC
Add Parameter to request from Screen actions
Hello Everyone,
Heres what I am trying to do. I pass a parameter from a URL which
calls a Screen. Now I want to add one more parameter with a different name
to the request in the actions section of the screen.
Heres the address -
http://localhost/xyz/control/additem/~category_id=0200/~add_product_id=DEMO
_PRODUCT_04/~quantity=1/
I want to add product_id in the request but I cant add it in the above URL
else it would have looked like
http://localhost/xyz/control/additem/~category_id=0200/~add_product_id=DEMO_
PRODUCT_04/~quantity=1/~product_id=DEMO_PRODUCT_04
I tried this but it didnt work -
<section>
<actions>
<set field="parameters.product_id"
from-field="parameters.add_product_id"/>
....
</actions>
<section>
Is it possible to add product_id programmatically in the parameters map?
Any inputs would be appreciated.
Thanks in advance,
Amit Shinde
RE: Add Parameter to request from Screen actions
Posted by Amit Shinde <am...@amicontech.com>.
David,
Adding the parameter onto the link is definitely the best
solution. But I was wondering for my knowledge, if we could add that
parameter from the screen actions. That way I wouldnt have to go search
every ftl where this link is called.
So is it possible to add more parameters to the requestparameters Map.
Imagine that this is the link that is present in a ton of ftl pages -
http://localhost/xyz/control/additem/~category_id=0200/~add_product_id=DEMO
_PRODUCT_04/~quantity=1/
I could definitely go in every ftl file and add a parameter and link would
be -
http://localhost/xyz/control/additem/~category_id=0200/~add_product_id=DEMO
_PRODUCT_04/~quantity=1/~product_id=DEMO_PRODUCT_04
You will notice that the new parameter 'product_id' has the same value as
'add_product_id'. The question is, is this the best way or can I do
something from Screen actions to add the parameter which would save me tons
of time. All I want to do is add 'product_id' to the input parameters Map
from the actions part.
Thanks a lot for your response,
Amit Shinde
-----Original Message-----
From: David E Jones [mailto:jonesde@undersunconsulting.com]
Sent: Saturday, December 02, 2006 7:32 AM
To: ofbiz-user@incubator.apache.org
Subject: Re: Add Parameter to request from Screen actions
I'm not sure what you're getting at here, but my guess is you are
trying to output parameters into the input parameters Map. To get a
parameter onto a link or other URL, it needs to be added wherever
that URL is defined, like in the form def or ftl file, or whatever.
-David
On Dec 1, 2006, at 5:04 PM, Amit Shinde wrote:
> Hello Everyone,
> Heres what I am trying to do. I pass a parameter from a
> URL which
> calls a Screen. Now I want to add one more parameter with a
> different name
> to the request in the actions section of the screen.
>
> Heres the address -
>
> http://localhost/xyz/control/additem/~category_id=0200/
> ~add_product_id=DEMO
> _PRODUCT_04/~quantity=1/
>
> I want to add product_id in the request but I cant add it in the
> above URL
> else it would have looked like
> http://localhost/xyz/control/additem/~category_id=0200/
> ~add_product_id=DEMO_
> PRODUCT_04/~quantity=1/~product_id=DEMO_PRODUCT_04
>
> I tried this but it didnt work -
> <section>
> <actions>
> <set field="parameters.product_id"
> from-field="parameters.add_product_id"/>
> ....
> </actions>
> <section>
>
> Is it possible to add product_id programmatically in the
> parameters map?
>
> Any inputs would be appreciated.
>
> Thanks in advance,
>
> Amit Shinde
>
>
Re: Add Parameter to request from Screen actions
Posted by tibor katelbach <oc...@gmail.com>.
Hi Amit
you can retreive your request parameters in the action section of your
SCreen Widget like this : parameters.add_product_id. you can set it on
another variable to reuse in your ftl if you like
Tibor
On 12/4/06, David E Jones <jo...@undersunconsulting.com> wrote:
>
>
> If I understand right you are trying to add a parameter to an
> outgoing link, or the HTML in the file being sent to the client. This
> has absolutely nothing to do with incoming parameters or attributes,
> which is what the parameters Map represents.
>
> It would certainly be possible to implement something like this, but
> would you really want to add a parameter to ALL links on a page?
>
> -David
>
>
> On Dec 3, 2006, at 9:46 PM, Amit Shinde wrote:
>
> > David,
> > Adding the parameter onto the link is definitely the best
> > solution. But I was wondering for my knowledge, if we could add that
> > parameter from the screen actions. That way I wouldnt have to go
> > search
> > every ftl where this link is called.
> >
> > So is it possible to add more parameters to the requestparameters
> > Map.
> >
> > Imagine that this is the link that is present in a ton of ftl
> pages -
> >
> > http://localhost/xyz/control/additem/~category_id=0200/
> > ~add_product_id=DEMO
> > _PRODUCT_04/~quantity=1/
> >
> > I could definitely go in every ftl file and add a parameter and
> > link would
> > be -
> >
> > http://localhost/xyz/control/additem/~category_id=0200/
> > ~add_product_id=DEMO
> > _PRODUCT_04/~quantity=1/~product_id=DEMO_PRODUCT_04
> >
> > You will notice that the new parameter 'product_id' has the same
> > value as
> > 'add_product_id'. The question is, is this the best way or can I do
> > something from Screen actions to add the parameter which would save
> > me tons
> > of time. All I want to do is add 'product_id' to the input
> > parameters Map
> > from the actions part.
> >
> >
> > Thanks a lot for your response,
> >
> > Amit Shinde
> >
> >
> >
> >
> > -----Original Message-----
> > From: David E Jones [mailto:jonesde@undersunconsulting.com]
> > Sent: Saturday, December 02, 2006 7:32 AM
> > To: ofbiz-user@incubator.apache.org
> > Subject: Re: Add Parameter to request from Screen actions
> >
> >
> >
> > I'm not sure what you're getting at here, but my guess is you are
> > trying to output parameters into the input parameters Map. To get a
> > parameter onto a link or other URL, it needs to be added wherever
> > that URL is defined, like in the form def or ftl file, or whatever.
> >
> > -David
> >
> >
> > On Dec 1, 2006, at 5:04 PM, Amit Shinde wrote:
> >
> >> Hello Everyone,
> >> Heres what I am trying to do. I pass a parameter from a
> >> URL which
> >> calls a Screen. Now I want to add one more parameter with a
> >> different name
> >> to the request in the actions section of the screen.
> >>
> >> Heres the address -
> >>
> >> http://localhost/xyz/control/additem/~category_id=0200/
> >> ~add_product_id=DEMO
> >> _PRODUCT_04/~quantity=1/
> >>
> >> I want to add product_id in the request but I cant add it in the
> >> above URL
> >> else it would have looked like
> >> http://localhost/xyz/control/additem/~category_id=0200/
> >> ~add_product_id=DEMO_
> >> PRODUCT_04/~quantity=1/~product_id=DEMO_PRODUCT_04
> >>
> >> I tried this but it didnt work -
> >> <section>
> >> <actions>
> >> <set field="parameters.product_id"
> >> from-field="parameters.add_product_id"/>
> >> ....
> >> </actions>
> >> <section>
> >>
> >> Is it possible to add product_id programmatically in the
> >> parameters map?
> >>
> >> Any inputs would be appreciated.
> >>
> >> Thanks in advance,
> >>
> >> Amit Shinde
> >>
> >>
> >
> >
>
>
Re: Add Parameter to request from Screen actions
Posted by David E Jones <jo...@undersunconsulting.com>.
If I understand right you are trying to add a parameter to an
outgoing link, or the HTML in the file being sent to the client. This
has absolutely nothing to do with incoming parameters or attributes,
which is what the parameters Map represents.
It would certainly be possible to implement something like this, but
would you really want to add a parameter to ALL links on a page?
-David
On Dec 3, 2006, at 9:46 PM, Amit Shinde wrote:
> David,
> Adding the parameter onto the link is definitely the best
> solution. But I was wondering for my knowledge, if we could add that
> parameter from the screen actions. That way I wouldnt have to go
> search
> every ftl where this link is called.
>
> So is it possible to add more parameters to the requestparameters
> Map.
>
> Imagine that this is the link that is present in a ton of ftl pages -
>
> http://localhost/xyz/control/additem/~category_id=0200/
> ~add_product_id=DEMO
> _PRODUCT_04/~quantity=1/
>
> I could definitely go in every ftl file and add a parameter and
> link would
> be -
>
> http://localhost/xyz/control/additem/~category_id=0200/
> ~add_product_id=DEMO
> _PRODUCT_04/~quantity=1/~product_id=DEMO_PRODUCT_04
>
> You will notice that the new parameter 'product_id' has the same
> value as
> 'add_product_id'. The question is, is this the best way or can I do
> something from Screen actions to add the parameter which would save
> me tons
> of time. All I want to do is add 'product_id' to the input
> parameters Map
> from the actions part.
>
>
> Thanks a lot for your response,
>
> Amit Shinde
>
>
>
>
> -----Original Message-----
> From: David E Jones [mailto:jonesde@undersunconsulting.com]
> Sent: Saturday, December 02, 2006 7:32 AM
> To: ofbiz-user@incubator.apache.org
> Subject: Re: Add Parameter to request from Screen actions
>
>
>
> I'm not sure what you're getting at here, but my guess is you are
> trying to output parameters into the input parameters Map. To get a
> parameter onto a link or other URL, it needs to be added wherever
> that URL is defined, like in the form def or ftl file, or whatever.
>
> -David
>
>
> On Dec 1, 2006, at 5:04 PM, Amit Shinde wrote:
>
>> Hello Everyone,
>> Heres what I am trying to do. I pass a parameter from a
>> URL which
>> calls a Screen. Now I want to add one more parameter with a
>> different name
>> to the request in the actions section of the screen.
>>
>> Heres the address -
>>
>> http://localhost/xyz/control/additem/~category_id=0200/
>> ~add_product_id=DEMO
>> _PRODUCT_04/~quantity=1/
>>
>> I want to add product_id in the request but I cant add it in the
>> above URL
>> else it would have looked like
>> http://localhost/xyz/control/additem/~category_id=0200/
>> ~add_product_id=DEMO_
>> PRODUCT_04/~quantity=1/~product_id=DEMO_PRODUCT_04
>>
>> I tried this but it didnt work -
>> <section>
>> <actions>
>> <set field="parameters.product_id"
>> from-field="parameters.add_product_id"/>
>> ....
>> </actions>
>> <section>
>>
>> Is it possible to add product_id programmatically in the
>> parameters map?
>>
>> Any inputs would be appreciated.
>>
>> Thanks in advance,
>>
>> Amit Shinde
>>
>>
>
>
RE: Add Parameter to request from Screen actions
Posted by Chris Howe <cj...@yahoo.com>.
I believe your issue is with the lack of a
setParameter(String name, String value) method in
Java's ServletRequest Class (and by extension
HttpServletRequest sub interface).
If you wish to change a user's request by appending,
deleting or changing information, you must read the
the parameter map into an attribute map (or additional
map of your choosing) and then only use the
information from the attribute map for any "work" that
needs to be done. Otherwise, you must setup the
request paramter map by changing the request in each
ftl (or screen definition, etc).
Ref:
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest.html
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4255707
--- Amit Shinde <am...@amicontech.com> wrote:
> David,
> Adding the parameter onto the link is
> definitely the best
> solution. But I was wondering for my knowledge, if
> we could add that
> parameter from the screen actions. That way I
> wouldnt have to go search
> every ftl where this link is called.
>
> So is it possible to add more parameters to the
> requestparameters Map.
>
> Imagine that this is the link that is present in a
> ton of ftl pages -
>
>
>
http://localhost/xyz/control/additem/~category_id=0200/~add_product_id=DEMO
> _PRODUCT_04/~quantity=1/
>
> I could definitely go in every ftl file and add a
> parameter and link would
> be -
>
>
>
http://localhost/xyz/control/additem/~category_id=0200/~add_product_id=DEMO
> _PRODUCT_04/~quantity=1/~product_id=DEMO_PRODUCT_04
>
> You will notice that the new parameter 'product_id'
> has the same value as
> 'add_product_id'. The question is, is this the best
> way or can I do
> something from Screen actions to add the parameter
> which would save me tons
> of time. All I want to do is add 'product_id' to the
> input parameters Map
> from the actions part.
>
>
> Thanks a lot for your response,
>
> Amit Shinde
>
>
>
>
> -----Original Message-----
> From: David E Jones
> [mailto:jonesde@undersunconsulting.com]
> Sent: Saturday, December 02, 2006 7:32 AM
> To: ofbiz-user@incubator.apache.org
> Subject: Re: Add Parameter to request from Screen
> actions
>
>
>
> I'm not sure what you're getting at here, but my
> guess is you are
> trying to output parameters into the input
> parameters Map. To get a
> parameter onto a link or other URL, it needs to be
> added wherever
> that URL is defined, like in the form def or ftl
> file, or whatever.
>
> -David
>
>
> On Dec 1, 2006, at 5:04 PM, Amit Shinde wrote:
>
> > Hello Everyone,
> > Heres what I am trying to do. I pass a
> parameter from a
> > URL which
> > calls a Screen. Now I want to add one more
> parameter with a
> > different name
> > to the request in the actions section of the
> screen.
> >
> > Heres the address -
> >
> >
>
http://localhost/xyz/control/additem/~category_id=0200/
> > ~add_product_id=DEMO
> > _PRODUCT_04/~quantity=1/
> >
> > I want to add product_id in the request but I
> cant add it in the
> > above URL
> > else it would have looked like
> >
>
http://localhost/xyz/control/additem/~category_id=0200/
> > ~add_product_id=DEMO_
> > PRODUCT_04/~quantity=1/~product_id=DEMO_PRODUCT_04
> >
> > I tried this but it didnt work -
> > <section>
> > <actions>
> > <set field="parameters.product_id"
> > from-field="parameters.add_product_id"/>
> > ....
> > </actions>
> > <section>
> >
> > Is it possible to add product_id programmatically
> in the
> > parameters map?
> >
> > Any inputs would be appreciated.
> >
> > Thanks in advance,
> >
> > Amit Shinde
> >
> >
>
>
>
RE: Add Parameter to request from Screen actions
Posted by Amit Shinde <am...@amicontech.com>.
David,
Adding the parameter onto the link is definitely the best
solution. But I was wondering for my knowledge, if we could add that
parameter from the screen actions. That way I wouldnt have to go search
every ftl where this link is called.
So is it possible to add more parameters to the requestparameters Map.
Imagine that this is the link that is present in a ton of ftl pages -
http://localhost/xyz/control/additem/~category_id=0200/~add_product_id=DEMO
_PRODUCT_04/~quantity=1/
I could definitely go in every ftl file and add a parameter and link would
be -
http://localhost/xyz/control/additem/~category_id=0200/~add_product_id=DEMO
_PRODUCT_04/~quantity=1/~product_id=DEMO_PRODUCT_04
You will notice that the new parameter 'product_id' has the same value as
'add_product_id'. The question is, is this the best way or can I do
something from Screen actions to add the parameter which would save me tons
of time. All I want to do is add 'product_id' to the input parameters Map
from the actions part.
Thanks a lot for your response,
Amit Shinde
-----Original Message-----
From: David E Jones [mailto:jonesde@undersunconsulting.com]
Sent: Saturday, December 02, 2006 7:32 AM
To: ofbiz-user@incubator.apache.org
Subject: Re: Add Parameter to request from Screen actions
I'm not sure what you're getting at here, but my guess is you are
trying to output parameters into the input parameters Map. To get a
parameter onto a link or other URL, it needs to be added wherever
that URL is defined, like in the form def or ftl file, or whatever.
-David
On Dec 1, 2006, at 5:04 PM, Amit Shinde wrote:
> Hello Everyone,
> Heres what I am trying to do. I pass a parameter from a
> URL which
> calls a Screen. Now I want to add one more parameter with a
> different name
> to the request in the actions section of the screen.
>
> Heres the address -
>
> http://localhost/xyz/control/additem/~category_id=0200/
> ~add_product_id=DEMO
> _PRODUCT_04/~quantity=1/
>
> I want to add product_id in the request but I cant add it in the
> above URL
> else it would have looked like
> http://localhost/xyz/control/additem/~category_id=0200/
> ~add_product_id=DEMO_
> PRODUCT_04/~quantity=1/~product_id=DEMO_PRODUCT_04
>
> I tried this but it didnt work -
> <section>
> <actions>
> <set field="parameters.product_id"
> from-field="parameters.add_product_id"/>
> ....
> </actions>
> <section>
>
> Is it possible to add product_id programmatically in the
> parameters map?
>
> Any inputs would be appreciated.
>
> Thanks in advance,
>
> Amit Shinde
>
>
Re: Add Parameter to request from Screen actions
Posted by David E Jones <jo...@undersunconsulting.com>.
I'm not sure what you're getting at here, but my guess is you are
trying to output parameters into the input parameters Map. To get a
parameter onto a link or other URL, it needs to be added wherever
that URL is defined, like in the form def or ftl file, or whatever.
-David
On Dec 1, 2006, at 5:04 PM, Amit Shinde wrote:
> Hello Everyone,
> Heres what I am trying to do. I pass a parameter from a
> URL which
> calls a Screen. Now I want to add one more parameter with a
> different name
> to the request in the actions section of the screen.
>
> Heres the address -
>
> http://localhost/xyz/control/additem/~category_id=0200/
> ~add_product_id=DEMO
> _PRODUCT_04/~quantity=1/
>
> I want to add product_id in the request but I cant add it in the
> above URL
> else it would have looked like
> http://localhost/xyz/control/additem/~category_id=0200/
> ~add_product_id=DEMO_
> PRODUCT_04/~quantity=1/~product_id=DEMO_PRODUCT_04
>
> I tried this but it didnt work -
> <section>
> <actions>
> <set field="parameters.product_id"
> from-field="parameters.add_product_id"/>
> ....
> </actions>
> <section>
>
> Is it possible to add product_id programmatically in the
> parameters map?
>
> Any inputs would be appreciated.
>
> Thanks in advance,
>
> Amit Shinde
>
>