summaryrefslogtreecommitdiffstats
path: root/java/sca/tutorial/store-mashup
diff options
context:
space:
mode:
Diffstat (limited to 'java/sca/tutorial/store-mashup')
-rw-r--r--java/sca/tutorial/store-mashup/gadget/store-gadget.html30
1 files changed, 24 insertions, 6 deletions
diff --git a/java/sca/tutorial/store-mashup/gadget/store-gadget.html b/java/sca/tutorial/store-mashup/gadget/store-gadget.html
index c2a8ba5118..c09b9d28c8 100644
--- a/java/sca/tutorial/store-mashup/gadget/store-gadget.html
+++ b/java/sca/tutorial/store-mashup/gadget/store-gadget.html
@@ -35,7 +35,11 @@
var catalogItems;
- function catalog_getResponse(items) {
+ function catalog_getResponse(items,exception) {
+ if(exception){
+ alert(exception.message);
+ return;
+ }
var catalog = "";
for (var i=0; i<items.length; i++) {
var item = items[i].name + ' - ' + items[i].price;
@@ -58,13 +62,22 @@
}
document.getElementById("shoppingCart").innerHTML = list;
- if (entries.length != 0) {
- shoppingTotal.getTotal(shoppingTotal_getTotalResponse);
+ if (entries.length != 0) {
+ try {
+ shoppingTotal.getTotal(shoppingTotal_getTotalResponse);
+ }
+ carch(e) {
+ alert(e);
+ }
}
}
}
- function shoppingTotal_getTotalResponse(total) {
+ function shoppingTotal_getTotalResponse(total,exception) {
+ if(exception){
+ alert(exception.message);
+ return;
+ }
document.getElementById('total').innerHTML = total;
}
@@ -113,8 +126,13 @@
}
function init() {
- catalog.get(catalog_getResponse);
- shoppingCart.get("", shoppingCart_getResponse);
+ try {
+ catalog.get(catalog_getResponse);
+ shoppingCart.get("", shoppingCart_getResponse);
+ }
+ catch(e) {
+ alert(e);
+ }
}
</script>