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
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@7739 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/bikeshed/src/com/google/gwt/valuestore/client/ValuesImpl.java b/bikeshed/src/com/google/gwt/valuestore/client/ValuesImpl.java
index 95adff3..47038e6 100644
--- a/bikeshed/src/com/google/gwt/valuestore/client/ValuesImpl.java
+++ b/bikeshed/src/com/google/gwt/valuestore/client/ValuesImpl.java
@@ -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] + '"' + '; ';
+ var replacer = function(key, value) {
+ if (key == 'propertyHolder') {
+ return;
}
+ return value;
}
- return output;
+ return JSON.stringify(this, replacer);
}-*/;
private native Date dateForDouble(double millis) /*-{
diff --git a/bikeshed/war/Expenses.html b/bikeshed/war/Expenses.html
index 24733bd..6182ba0 100644
--- a/bikeshed/war/Expenses.html
+++ b/bikeshed/war/Expenses.html
@@ -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>