Skip to main content

AjaxResult.JSON | AjaxResult.XML

1 reply [Last post]
ventje
Offline
Joined: 2006-11-21

Hi all,
i am new to jMaki and did some test tonight. i have a real own application running. A Combobx is filled from a Bean:

result.setResponseType(AjaxResult.JSON);
result.append("[[\"Set value to a\",\"a\" ],[\"Set value to b\",\"b\" ]]");

i want to use my config-stack from another application witch is fully xml based, so i think it is a good idea to use:

result.setResponseType(AjaxResult.XML);

but i can't find any docu or example,
can you help me?

thanx a lot.
Ven

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gmurray71
Offline
Joined: 2003-07-31

Hi,

Basically what the AjaxResult.JSON and AjaxResult.XML does is set the response content type to either JSON or XML based on this property. Your widgets will need to be able to consume XML for the second to work. Currently the Dojo Combobox only understands XML so you would need to modify the widget to take the new content type.

So just to be clear, the property is for only setting the content-type (no magic). Your widgets need to understand the return format.

Generally jMaki widgets are wired to understand JSON format. The data formats are described at:

http://wiki.java.net/bin/view/Projects/jMakiDataModels

As far as JSF is concerned it wants to render responses that are text (JSON) that confirm to the models.

-Greg