tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkuhn...@apache.org
Subject svn commit: r488746 - in /tapestry/tapestry4/trunk: tapestry-examples/TimeTracker/src/context/ tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/ tapestry-framework/src/java/org/apache/tapestry/dojo/html/ tapestry-framework/sr...
Date Tue, 19 Dec 2006 18:05:38 GMT
Author: jkuhnert
Date: Tue Dec 19 10:05:37 2006
New Revision: 488746

URL: http://svn.apache.org/viewvc?view=rev&rev=488746
Log:
-) Improved InlineEditBox use of local vars in javascript template to have unique names.

-) Updated JSONWriter to always write a valid minimal "{}" if no response updates have been
made at all so that 
client side js evaluations of the response data don't fail.

Modified:
    tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/Home.html
    tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/TaskEntryPage.java
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/dojo/html/InlineEditBox.java
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/dojo/html/InlineEditBox.script
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/markup/JSONWriterImpl.java
    tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js

Modified: tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/Home.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/Home.html?view=diff&rev=488746&r1=488745&r2=488746
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/Home.html (original)
+++ tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/Home.html Tue Dec 19
10:05:37 2006
@@ -48,7 +48,6 @@
       			async="true" updateComponents="taskForm" />
       </td>
     </tr>
-    
     </table>
     </fieldset>
 </form>

Modified: tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/TaskEntryPage.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/TaskEntryPage.java?view=diff&rev=488746&r1=488745&r2=488746
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/TaskEntryPage.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/java/org/apache/tapestry/timetracker/page/TaskEntryPage.java
Tue Dec 19 10:05:37 2006
@@ -132,6 +132,7 @@
     @EventListener(events = "onSave", targets="projName")
     public void onNameUpdate()
     {
-        getProjectDao().update(getSelectedProject());
+        if (getSelectedProject() != null)
+            getProjectDao().update(getSelectedProject());
     }
 }

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/dojo/html/InlineEditBox.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/dojo/html/InlineEditBox.java?view=diff&rev=488746&r1=488745&r2=488746
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/dojo/html/InlineEditBox.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/dojo/html/InlineEditBox.java
Tue Dec 19 10:05:37 2006
@@ -90,9 +90,7 @@
         if (!cycle.isRewinding()) {
             
             writer.begin(getTemplateTagName()); // use whatever template tag they specified
-            
             renderInformalParameters(writer, cycle);
-            
             renderIdAttribute(writer, cycle);
         }
         

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/dojo/html/InlineEditBox.script
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/dojo/html/InlineEditBox.script?view=diff&rev=488746&r1=488745&r2=488746
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/dojo/html/InlineEditBox.script
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/dojo/html/InlineEditBox.script
Tue Dec 19 10:05:37 2006
@@ -21,6 +21,9 @@
 
 <input-symbol key="component" required="yes" />
 <input-symbol key="props" required="yes" />
+<let key="box" unique="yes">
+inlineBox
+</let>
     <body>
     <unique>
     dojo.require("tapestry.widget.Widget");
@@ -29,15 +32,15 @@
     <initialization>
     tapestry.widget.synchronizeWidgetState("${component.clientId}", "InlineEditBox", ${props},
${component.destroy});
     
-    var w=dojo.widget.byId("${component.clientId}");
+    var ${box}=dojo.widget.byId("${component.clientId}");
     <if-not expression="component.disabled">
-        w.enable();
+        ${box}.enable();
     </if-not><if expression="component.disabled">
-        w.disable();
+        ${box}.disable();
     </if>
     
     <if expression="component.destroy">
-    dojo.event.connectOnce(w, "onSave", function(newValue, oldValue){
+    dojo.event.connectOnce(${box}, "onSave", function(newValue, oldValue){
     	tapestry.bind("${component.updateUrl}", {"${component.clientId}":newValue}, true);
     });
     </if>

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/markup/JSONWriterImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/markup/JSONWriterImpl.java?view=diff&rev=488746&r1=488745&r2=488746
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/markup/JSONWriterImpl.java
(original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/markup/JSONWriterImpl.java
Tue Dec 19 10:05:37 2006
@@ -59,12 +59,15 @@
      */
     public void close()
     {
-        if (_json != null && _json.length() > 0) {
+        if (_json == null && _array == null)
+            _json = new JSONObject();
+        
+        if (_json != null) {
             
             _writer.write(_json.toString());
         }
         
-        if (_array != null && _array.length() > 0) {
+        if (_array != null) {
             
             _writer.write(_array.toString());
         }

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js?view=diff&rev=488746&r1=488745&r2=488746
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/js/tapestry/core.js Tue Dec 19 10:05:37
2006
@@ -42,7 +42,6 @@
 			content:content,
             useCache:true,
             preventCache:true,
-            load: (function(){tapestry.load.apply(this, arguments);}),
             error: (function(){tapestry.error.apply(this, arguments);})
 		};
 		
@@ -50,10 +49,12 @@
 		if (typeof json != "undefined" && json == true) {
 			parms.mimetype = "text/json";
 			parms.headers={"json":true};
+			parms.load=(function(){tapestry.loadJson.apply(this, arguments);});
 		} else {
 			parms.headers={"dojo-ajax-request":true};
 			parms.mimetype="text/xml";
 			parms.encoding="UTF-8";
+			parms.load=(function(){tapestry.load.apply(this, arguments);});
 		}
 		
 		dojo.io.queueBind(parms);
@@ -90,9 +91,7 @@
 	 * 
 	 */
 	load:function(type, data, http, kwArgs){
-		if (djConfig["isDebug"]) {
-			dojo.log.debug("Response recieved.", data);
-		}
+		dojo.log.debug("tapestry.load() Response recieved.", data);
 		if (!data) {
 			dojo.log.warn("No data received in response.");
 			return;
@@ -163,6 +162,10 @@
 		for (var i=0; i<initScripts.length; i++) {
 			tapestry.loadScriptContent(initScripts[i], true);
 		}
+	},
+	
+	loadJson:function(type, data, http, kwArgs){
+		dojo.log.debug("tapestry.loadJson() Response recieved.", data);
 	},
 	
 	/**



Mime
View raw message