Hello there,In case you have JSONString then you can use .stringValue() and
for numbers you can use .getValue();
there is no need to do it manually.

regards,
ruds

On Wed, Apr 29, 2009 at 11:16 AM, newtoGWT <[email protected]> wrote:

>
>
> Please find my code below:
>
> Inside action class
>     import net.sf.json.JSON;
>     import net.sf.json.JSONSerializer;
>     .......
>     .......
>     ValueBean value = new VallueBean();
>     value.setPlainText("Search Result");
>     JSON json = JSONSerializer.toJSON(writingsAssetValue);
>     response.getWriter().write(json.toString());
>
> Inside GWT class
>     public void onResponseReceived(Request request, Response
> response) {
>              if (200 == response.getStatusCode()) {
>                  JSONValue jsonValue = JSONParser.parse(response.getText
> ());
>                  searchButton.setEnabled(true);
>                  Window.alert(jsonValue.toString());
>                  Window.alert(jsonValue.isObject().get
> ("plainText").toString().replace("\"", ""));
>                  flexTable.setHTML(row, 1, value.isObject().get
> ("plainText").toString());
>              } else {
>                // Handle the error.  Can get the status text from
> response.getStatusText()
>              }
>            }
>
> The problem here is Window.alert(jsonValue.toString()); displays
> "plainText":"Search Result"
>
> but i expected Window.alert(jsonValue.isObject().get
> ("plainText").toString()) to display
> Search Result (with out any double quotes) but it displayed as "Search
> Result"
>
> i  fixed this temp. by using replace method but i want to know whether
> this is the only way by which i can fix the double quote issue? or
> whether i am doing some thing wrong.
>
> Any help on this would be appreciated..
>
> Thanks!
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to