You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by Bob Schellink <sa...@gmail.com> on 2010/07/10 07:14:54 UTC

Re: xml file géneration

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

Re: xml file generation

Posted by Bob Schellink <sa...@gmail.com>.
On 10/07/2010 17:46, easydoor wrote:
> Many Thanks Bob ! 
> I look this, there is another Jquery Plugin named Datatables 
> on datatables.net which seems to be interesting too ...


Agree, both Datatables.net and jQGrid looks quite impressive.

I've added a couple of AJAX examples showing how to return JSON and XML. Its available from our
nightly builds:

http://hudson.zones.apache.org/hudson/view/Click/job/Click/ws/

regards

Bob

Re: xml file generation

Posted by easydoor <ch...@valdoise.fr>.
Many Thanks Bob ! 
I look this, there is another Jquery Plugin named Datatables 
on datatables.net which seems to be interesting too ...