1 Reply Latest reply on Aug 5, 2009 10:23 PM by Murilo da Silva

    a4j:commandButton and attribute data using JSON

    Murilo da Silva Newbie


      I'm with the following problem:

        <h:commandButton action="#{bean.myAction}" data="#{bean.myValue}" oncomplete="alert(data.erro)">

      I would like to know is: How can I serialize bean.myValue?
      I try it like String with this syntax:

      myValue = "{\"erro\": \"true\" }"

      I try to use a JSONObject:

      JSONObject aux = new JSONObject();
      aux.put("erro", "true");
      myValue = aux.toString();

      But none of them works, always return undefined on js alert!!

      Someone please????