On 10/07/2010 00:54, easydoor wrote:
> I'm trying to integrate the jQuery jQGrid Plugin in Click. 
> There are two ways to loading data in the datagrid :
> one by JSON
> one by XML


Interesting. So they don't provide support for HTML? Generally jQuery plugins 
are used to "enhance"
the markup from a webpage. Sounds as if jQGrid is more of a standalone RIA 
component?


> I created a Click Page which have to generate an XML flow with this format : 
> 
> <?xml version="1.0" encoding="utf-8" ?> 
> ...
> <![CDATA[ LOUVRES]]></cell>
> </row>
> </rows>
> 
> the html code page is $jsonString which contains the string below (xml file)


So $jsonString contains XML markup and not JSON? Why not call it $xmlString 
instead?


> When i launch this page, the display result is : 512345 ? and 
> i have no result in my datagrid
> The source code of the page is good --> XML Code
> Why the Click Servlet doesn't translate the XML ?

Click Pages by default serve HTML content. If you use the Page template to 
serve XML or JSON you
need to change the ContentType accordingly:

MyPage extends Page {

  public String getContentType() {
    return "text/xml; charset=UTF-8";
    //return "application/json; charset=UTF-8";
  }
}

Using Firebug you can confirm the content type of a response. Look under the 
"Net" panel ->
"Headers" -> "Response Headers" -> "Content-Type".

Kind regards

Bob

Reply via email to