-
1. Re: Problem sending parameter objects to another view while
nbelaevski Aug 29, 2009 7:45 AM (in response to shayan)Hi,
If you are not using redirect navigation, then all beans should be available when view B is rendered to the client, otherwise request scoped beans will be recreated because redirect happens in a separate request. -
2. Re: Problem sending parameter objects to another view while
shayan Aug 31, 2009 3:01 AM (in response to shayan)Thanks for the reply.
yes. backing bean of View A will be available to Vew B but in that case view B will be using backing bean of View A. and Ii want to move to Backing bean of view B. so I will have to send the object to the next backing bean that is of View B's backing.
How will i do this?? -
3. Re: Problem sending parameter objects to another view while
nbelaevski Aug 31, 2009 5:33 AM (in response to shayan)Sorry, but I don't understand your question. Please clarify what do you exactly mean by "send the object to the next backing bean"?
-
4. Re: Problem sending parameter objects to another view while
shayan Aug 31, 2009 6:56 AM (in response to shayan)suppose view A has backingBeanA and view B has backingBeanB. User initiates a request on view A which is processed by an action listener in backingBeanA and an object is returned by the busines logic layer in response. This object contains results of the process. Now the user is to be directed to view B which has backingBeanB and the result of the process is to shown on view B. So In this case, the resulted object should passed to the backingBeanB so that view B should ba able to show its values.
According to your first reply, backingBeanA remains available to view B and can show the resulted object of the processing, but view B has its own backing bean and it should show the values from its own backing bean.
I hope you would have understand the scenario.... -
5. Re: Problem sending parameter objects to another view while
ilya_shaikovsky Aug 31, 2009 10:04 AM (in response to shayan)unfortunatelly still not clear. Maybe some code sample?
-
6. Re: Problem sending parameter objects to another view while
shayan Sep 1, 2009 12:18 AM (in response to shayan)Ok. Here is a real life scenario.
This is about an online shopping scenario.
There are two views when a customer selects an item to buy. On the first view customer will enter the details of his credit card, his country, state etc. Then after filling form user will click on next button which will invoke action method "createOrder" of backing bean named "CreateOrderController". That is
public String createOrder(){
}
In createOrder method, use'sr country and state information will be processed for calculation of tax charges and shipment charges.
like
public String createOrder(){
Order order=new Order();
order.set....(...)
...................
Charges charges=chargesCalculator.calculateCharges(order);
return "success";
}
chargesCalculator.calculateCharges() method returns object of "Charges" which contains all info about the tax and shipment charges .
Now the user will be directed to next view when "success" is returned, where the user will be shown the complete charges for the item.This view is "CompleteOrderView" with backing bean named "CompleteOrderController".
Now on the complete order view, the user will have to be shown the charges which is encapsulated in the "Charges" object which means that this object must be passed to the "CompleteOrderController" in order to show its values.
So what i wanted to ask is that how to pass the "Charges" object from the "CreateOrderController" to "CompleteOrderController" ?? -
7. Re: Problem sending parameter objects to another view while
nbelaevski Sep 1, 2009 6:47 AM (in response to shayan)http://www.exforsys.com/tutorials/j2ee/servlet-basics.html
JBoss Seam introduces additional very useful scopes - check them also. -
8. Re: Problem sending parameter objects to another view while
shayan Sep 2, 2009 3:50 AM (in response to shayan)This link doesnt address my problem. Its not about wt my problem is.
Looks like i am unable to find solution to this problem on this forum :-( . Anyways, thanks for your replies....... -
9. Re: Problem sending parameter objects to another view while
nbelaevski Sep 2, 2009 5:53 AM (in response to shayan)You want to keep objects - scopes exists for that. The article described standard ones.
-
10. Re: Problem sending parameter objects to another view while
nbelaevski Sep 2, 2009 6:43 AM (in response to shayan)Also check keepAlive and state API demos at livedemo - both provide extended scopes.