Thats basically solution 1 I proposed, but somewhat easier then to check the entire response :-)

Werner


Am 14.06.10 13:31, schrieb Jakob Korherr:
Hi Mark and Werner,

You could also add a h:messages component to the page and re-render this one
in any ajax-request. If the dom-update for this component is not empty, then
you know that there are FacesMessages.

Regards,
Jakob

2010/6/13 Werner Punz<werner.p...@gmail.com>

Am 13.06.10 07:11, schrieb Mark Li:

  when i use jsf.ajax, i cant find out any information about facesmessage.
I have looked into "Event Object", but find nothing.

My situation is,

jsf.ajax.request(this, event,{
        onerror:function(data){alert('nothing happened!')},
        onevent:function(data){
        //if there is message do something. will do like keep dialog.
        //if there is no message do otherthings. will do like close dialog;
        }
} );


Can anyone help?

  Hi there is no direct handling of faces-messages in the protocol, if you
do a standard ajax request you will get something back like
<update id="bbb">html code to update</update>

so what you can do is to check the response for updated message fields.
The protocol unfortunately does not deal with messages directly all it does
is to deal with dom nodes which get updated.

The protocol allows following tags but only update is used due to a spec
limitation which hopefully will be lifted on 2.1
(on component level)

<update>
<insert>
<delete>
<attributes>
<eval>
<extension>  afair with extension being a place for specific extensions.

So currently both impls do not use extension but if you need direct access
to the faces messages you could add a custom mechanism (responsewriter,
maybe an event handler ), which drags them directly in and use the
extensions tag for this purpose, but then you have to parse them out also
via an event handler.


Werner






Reply via email to