Author: mrdon
Date: Fri Mar 25 16:45:34 2005
New Revision: 159080

URL: http://svn.apache.org/viewcvs?view=rev&rev=159080
Log:
Added more comments and cleaned out debugging

Modified:
    struts/flow/trunk/src/examples/WEB-INF/templates/numberguess.js

Modified: struts/flow/trunk/src/examples/WEB-INF/templates/numberguess.js
URL: 
http://svn.apache.org/viewcvs/struts/flow/trunk/src/examples/WEB-INF/templates/numberguess.js?view=diff&r1=159079&r2=159080
==============================================================================
--- struts/flow/trunk/src/examples/WEB-INF/templates/numberguess.js (original)
+++ struts/flow/trunk/src/examples/WEB-INF/templates/numberguess.js Fri Mar 25 
16:45:34 2005
@@ -13,13 +13,11 @@
 
     // send guess page to user and wait for response.  Specify only cheat() 
     // can be called remotely.
-    print("sending guess");
     forwardAndWait("guess", 
        { "hint"    : hint,
          "guesses" : guesses},
        ["cheat"]);
 
-    print("processing a user guess "+getRequestParams().guess);
     // process user's guess
     var guess = parseInt( getRequestParams().guess );
     guesses++;
@@ -49,6 +47,8 @@
     return {"secret":random, "guesses":guesses};
 }
 
+// This function intercepts the forward back to Struts and renders the content
+// directly using Javascript Templates
 function renderTemplate(page, bizdata) { 
    // if rpc call, use old forward, otherwise use template
    if (page == "n/a") {
@@ -77,5 +77,7 @@
    }
 }
 
+// Replace old forward method with ours, but keep a reference to it so we can
+// call it for remote flow responses
 this._oldForwardAndWait = _forwardAndWait;
 this._forwardAndWait = renderTemplate;



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to