Jacob (as he pointed out above) came up with what I think a rather
clever idea - using multiple HTTP response headers to embed
the multiple response sections.  Very untraditional, but I think it'll
work very well and scale nicely.

-- Adam

On 5/2/06, Travis Reeder <[EMAIL PROTECTED]> wrote:


> > Good point, this could easily be moved into AjaxRendererUtils.encodeAjax
> > since most of the form components just call back to that anyways to
handle
> > common cases.  I was heading in a different direction with the generic
> > listener update, where it would send the response wrapper and put the
pay
> > dirt in a cdata section, but it may be easier to just return different
types
> > of responses depending on the component.
>
> I'm not enthused about that - for one thing, it makes
> it essentially impossible to send responses from two different
> components in response to one request.  And that's so
> incredibly useful that you really shouldn't shut the door on it.
>
> IMO, MyFaces should just pick a blessed format for sending
> responses that is flexible enough to support multiple responses
> per request (and sending back at least both XML and HTML
> content, and preferably also embedded JSON), and just tell
> people to stick with that.
>
> Regards,
> Adam
>
>

You are absolutely correct Adam, and you reminded me why it is the way it
is.  The current way *does* support a response containing multiple
components, which is the case with the CommandButtonAjax component that will
return multiple errors or multiple successes for all the components in the
corresponding form.  The client side script also supports this too.

So as you suggested, it may be best to put HTML and JSON responses in CDATA
sections and stick to the standard response format.

Travis


Reply via email to