You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by greg jocher <gr...@digitalcane.com> on 2012/09/12 21:17:27 UTC

Override / extend events

Hi all

Is there a way to add/change parameters in an event and pass it to 
another (the "parent") event?

Eg:
Override addToCart, add a needed parameter and fire the "parent" event. 
(controller->response: type=request)

regards
greg








Re: Override / extend events

Posted by greg jocher <gr...@digitalcane.com>.
Hi

I've found the solution: setAttribute.. my bad!
addToCart combines parameters and attributes: 
UtilHttp.getCombinedMap(request)

Mea culpa!
greg

On 09/13/2012 07:22 PM, Awdesh Parihar wrote:
> Hi,
>
> Curious to know alternate best solution for problem.
>
> --
> Regards
> Awdesh Parihar
>



Re: Override / extend events

Posted by Awdesh Parihar <aw...@gmail.com>.
Hi,

Curious to know alternate best solution for problem.

--
Regards
Awdesh Parihar

Re: Override / extend events

Posted by greg jocher <gr...@digitalcane.com>.
Hi

thank you for your answer, here's a detail by example:

1. The problem:
We have virtual products with more than 2k variants.
The default generated varianttree is way to big (3mb).

2. Our solution:
We list all variants in selects and verify the combination either on 
submit or by ajax.
The problem with this solution is the missing productId which is 
"needed" by addToCart.
We can get the productId by ajax, but there are clients without js..

My idea was to override addToCart, add the productId to the parameter 
and point the response to the overridden event (response type=request)
But then, i have to wrap HttpServletRequest... which is more a hack than 
a solution.

So, is there a clean way to do such things with events or do we have to 
search for another solution?


On 09/13/2012 09:18 AM, Brajesh Patel wrote:
> Hi,
>
> Please provide more info for your question:
>
> comment inline:
>
> On Thu, Sep 13, 2012 at 12:47 AM, greg jocher <gr...@digitalcane.com>wrote:
>
>> Hi all
>>
>> Is there a way to add/change parameters in an event and pass it to another
>> (the "parent") event?
>>
> Event don't have any definition so need not to define any parameters, if
> you are working with service so need override that service in your
> customize component.
Yes, i know that - but if productId is not set for addToCart we get 
redirected to a form which asks for it.

>
>
>
>> Eg:
>> Override addToCart, add a needed parameter and fire the "parent" event.
>> (controller->response: type=request)
>>
>> regards
>> greg
>>
>>
>>
>>
>>
>>
>>
>>
>
regards
greg

Re: Override / extend events

Posted by Brajesh Patel <br...@gmail.com>.
Hi,

Please provide more info for your question:

comment inline:

On Thu, Sep 13, 2012 at 12:47 AM, greg jocher <gr...@digitalcane.com>wrote:

> Hi all
>
> Is there a way to add/change parameters in an event and pass it to another
> (the "parent") event?
>

Event don't have any definition so need not to define any parameters, if
you are working with service so need override that service in your
customize component.



>
> Eg:
> Override addToCart, add a needed parameter and fire the "parent" event.
> (controller->response: type=request)
>
> regards
> greg
>
>
>
>
>
>
>
>


-- 
Thanks
Brajesh Patel
Salmonllc.com
http://bigfish.salmonllc.com/bfDemo.html

skype: brajesh.patel11
Cell:- +91 8750709907