Re: Unexpected behavior when an action is within a WORepetition
Re: Unexpected behavior when an action is within a WORepetition
- Subject: Re: Unexpected behavior when an action is within a WORepetition
- From: "Jerry W. Walker" <email@hidden>
- Date: Sat, 14 Jan 2006 12:30:19 -0500
Hi, Xavier,
First, check to be sure that nothing is changing the structure of
your page containing the list of hyperlinks between the time you
create the page (with appendToResponse) and the time that the
invokeAction method is called to activate your addToCart method. If
there are any changes to the structure of the page during that
interval (such as WOConditional's value changing or the size of an
array in a WORepitition changing), WO will become thoroughly confused
and nearly any behavior is possible.
If you've checked that and NOTHING is changing the structure of that
page, several other things could cause the problem. If I were
tracking this down in my own code, I would probably start logging the
requests and responses at this point.
The following code inserted into your Application class file can help
you do that:
public WOResponse dispatchRequest( WORequest request )
{
if (displayHeaders) {
System.out.println( "*********** The request = " +
request.toString() );
if (displayHeaderContent)
System.out.println( "*********** The request content
= " + request.contentString() );
}
WOResponse response = super.dispatchRequest( request );
if (displayHeaders) {
System.out.println( "*********** The response = " +
response.toString() );
if (displayHeaderContent)
System.out.println( "*********** The response
content = " + response.contentString() );
}
return response;
}
You will also need to create and set two boolean iVars in Application
like this:
private boolean displayHeaders = true;
private boolean displayHeaderContent = true;
I include the two booleans in the code because I normally include
code similar to the above in all my apps and set the two booleans
from Java's Properties facility off the command line. That way, if I
run into a problem like yours I only have to rerun the app with the
properties set appropriately and I can immediately track the headers
and their content.
If this still doesn't help you isolate the error, perhaps the best
information to help us help you track it down is the Session.addToCart
() method source code. You might also include the .wod file entries
for your two hyperlinks that activate this action method.
If you need more help, please respond to the list so we can all help.
Best regards,
Jerry
On Jan 14, 2006, at 12:02 PM, Dev WO wrote:
Hi guys,
I don't think I'll get many answers on a week end, but just in case;)
I've got an hyperlink (action) inside a WORepetition.
The repetition list all items in a specific category.
The hyperlink simply add this item to the cart.
to make sure I gave enough details, the action that "addToCart" is
inside my Session.java file and it's get called from the hyperlink
above (passing the "item" as the parameter) and also from another
hyperlink when the user have the full description for a specific
item (and only this one).
So here's my problem:
-if I click on a second hyperlink on the same page (choosing a
second product from the same list), only the second item is
"remembered" but the quantity is actually set to 2.
So it's already causing me problem:( but it gets more wired because
if I keep on clicking on other items on this same page, the
quantity doesn't change and stay at 2, but the item in cart is
replaced by the latest item clicked...
I don't know what kind of details to provide, it's not a crash,
nothing is broken, it just don't work the way I though it would.
If anyone could give me a pointer on where to look at or what to
try, I'll be very happy:)
When the same action is called from a "full description" page,
everything behaves normally.
Thanks a lot and have a nice week end.
Xavier
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial
Strength Internet Enabled Systems
email@hidden
203 278-4085 office
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden