| Take a look at the following code extracted from one of my project's Session class: /** * Utility method that gets the context ID string * from the passed in request */ public String requestsContextID(WORequest aRequest){ String uri = aRequest.uri(); String eID = NSPathUtilities.lastPathComponent(uri); NSArray eIDs = NSArray.componentsSeparatedByString(eID, "."); String reqCID = "1"; if(eIDs.count() > 0){ reqCID = (String)eIDs.objectAtIndex(0); } return reqCID; } /** * Method inspects the passed in request to see if * the user backtracked. If the context ID for the request is 2 clicks * less than the context ID for the current WOContext, we know * they backtracked. */ public boolean didBacktrack(WORequest aRequest, WOContext aContext){ boolean didBacktrack = false; int reqCID = Integer.parseInt(requestsContextID(aRequest)); int cid = Integer.parseInt(aContext.contextID()); int delta = cid - reqCID; if(delta > 2){ didBacktrack = true; }else if(delta > 1){ // Might not have backtracked if their last // action was a direct action. I don't know the best way // to deal with this, but one way would include // overriding performActionNamed() on your WODirectActions // indicating the last request was a DirectAction if(!lastActionWasDA){ didBacktrack = true; } } lastActionWasDA = false; return didBacktrack; } /** * Overrides the ComponentAction handler to set the didBackTrack * flag */ public WOActionResults invokeAction(WORequest aRequest, WOContext aContext){ String reqCID = requestsContextID(aRequest); didBackTrack = didBacktrack(aRequest, aContext); return super.invokeAction(aRequest, aContext); } I hope this helps. Maybe you can do something similar based on this code to solve your particular problem. On Sep 14, 2006, at 10:15 AM, Ute Hoffmann wrote:
-- Robert Walker |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]
