Re: How can I notice if there are facesmessages via ajax

2010-06-23 Thread Mark Li
Hi everyone, 1、to Werner, i hates it too, i dont like use update, its not a universal solution. 2、to Jakob, h:messages is a solution, i used to use it. but when you want to show some message dialog, you have to add things in very page, even in every form. very ugly. my solution is hack the

Re: How can I notice if there are facesmessages via ajax

2010-06-23 Thread Werner Punz
Hi Mark this would be a good idea to post the problem in issue tracker for the spec, so that it might be covered in a future revision. Btw. a cleaner solution probably would be to write your own partial response writer on top of the existing one which adds the info regarding the messages (or

Re: How can I notice if there are facesmessages via ajax

2010-06-23 Thread 李析寒
Hi everyone, 1、to Werner, i hates it too, i dont like use update, its not a universal solution. 2、to Jakob, h:messages is a solution, i used to use it. but when you want to show some message dialog, you have to add things in very page, even in every form. very ugly. my solution is hack the

Re: How can I notice if there are facesmessages via ajax

2010-06-23 Thread Mark Li
Hi Werner, Thank you for help. but I don't really get your point about ResponseWriter extension. I looked around the code, and I only find out PartialReponseWriter object is instantiated in the hard code. I like below, org.apache.myfaces.context.servlet.PartialViewContextImpl{ ...

Re: How can I notice if there are facesmessages via ajax

2010-06-23 Thread Werner Punz
Hi the facesContext has a method getPartialReponseWriter, or getResponseWriter is giving back the partial response writer. By pushing your own FacesContext in (via the FacesContextFactory) you can override this mechanism by wrapping the system partial response writer and adding your messaging

Re: How can I notice if there are facesmessages via ajax

2010-06-23 Thread Werner Punz
Ok mea culpa the api to fetch the partial response writer is indeed FacesContext.getCurrentInstance().getPartialViewContext().getPartialResponseWriter() Still I am not sure if there is an extension point to replace the partial view context (a quick look at the spec indicates no). If there is

Re: How can I notice if there are facesmessages via ajax

2010-06-15 Thread Luca Graf (Inxmail GmbH)
I use this approach to decide if an dialog should be closed or keeped open (to show validation errors). form that holds the max Severity: h:form id=severityForm style=display:none; h:inputHidden id=maximumSeverity value=#{facesContext.maximumSeverity.ordinal}/ /h:form In my js callbacks i

Re: How can I notice if there are facesmessages via ajax

2010-06-14 Thread 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,

Re: How can I notice if there are facesmessages via ajax

2010-06-14 Thread Werner Punz
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

Re: How can I notice if there are facesmessages via ajax

2010-06-13 Thread Werner Punz
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!')},

How can I notice if there are facesmessages via ajax

2010-06-12 Thread 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