Revision: 7739
Author: amitman...@google.com
Date: Tue Mar 16 10:02:10 2010
Log: Initial patch that sends an update across the wire and persists it.
Review at http://gwt-code-reviews.appspot.com/221802
Patch by: amitmanjhi
Review by: rjrjr
http://code.google.com/p/google-web-toolkit/source/detail?r=7739
Modified:
/trunk/bikeshed/src/com/google/gwt/valuestore/client/ValuesImpl.java
/trunk/bikeshed/war/Expenses.html
=======================================
--- /trunk/bikeshed/src/com/google/gwt/valuestore/client/ValuesImpl.java
Mon Mar 15 08:44:11 2010
+++ /trunk/bikeshed/src/com/google/gwt/valuestore/client/ValuesImpl.java
Tue Mar 16 10:02:10 2010
@@ -73,16 +73,17 @@
}-*/;
/**
- * @return
+ * Return JSON representation using org.json library.
+ * @return returned string.
*/
public native String toJson() /*-{
- var output = "";
- for (property in this) {
- if (property != 'propertyHolder') {
- output += '"' + property + '": ' + '"' + this[property] + '"'
+ '; ';
- }
- }
- return output;
+ var replacer = function(key, value) {
+ if (key == 'propertyHolder') {
+ return;
+ }
+ return value;
+ }
+ return JSON.stringify(this, replacer);
}-*/;
private native Date dateForDouble(double millis) /*-{
=======================================
--- /trunk/bikeshed/war/Expenses.html Thu Mar 4 12:59:01 2010
+++ /trunk/bikeshed/war/Expenses.html Tue Mar 16 10:02:10 2010
@@ -18,6 +18,7 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Expenses</title>
<script type="text/javascript" language="javascript"
src="expenses/expenses.nocache.js"></script>
+ <script type="text/javascript" language="javascript"
src="json2.js"></script>
</head>
<body>
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors