0

I´m turning my website into an app using Jasonette, but I'm having trouble passing java values to javascript after success. I'm using the following code that is working fine:

JSON:

"actions": {
    "$foreground": {
    "type": "$reload"
    },
    "test_action": {
    "type": "$util.banner2",
    "success": {
        "type": "$agent.request",
        "options": {
        "id": "$webcontainer",
        "method": "testEcho"
        }
    }
}

Javascript:

$agent.trigger("test_action");
function testEcho(){
    $('#wrapper').find('#test').css({'color':'red'});
}

Java:

JSONObject json_test_value=new JSONObject();
String test_value = "xpto";
json_test_value.put("value1", test_value);
JasonHelper.next("success", action, json_test_value, event, context);

I want to get the test_value from java after success, in order to be able to use testEcho (test_value). It seems simple but for some reason I can not do.

Darm0ka
  • 192
  • 1
  • 14

0 Answers0