Ajax calls and jGrowl component

194 de afișări
Accesați primul mesaj necitit

Matías Blasi

necitită,
17 aug. 2012, 12:49:1017.08.2012
– tapestry...@googlegroups.com
Hi all,

Did you think in some mechanism for updating the jGrowl component in the client-side after every ajax request?

I have ajax requests that generate some messages... so it would be useful to update the jGrowl... I tried by adding:

if(request.isXHR()) {
JavaScriptCallback callback = new JavaScriptCallback() {
@Override
public void run(JavaScriptSupport javascriptSupport) {
                                                                //Forcing click in an action link which updates a zone wrapping the jGrowl component
javascriptSupport.addScript(InitializationPriority.LATE, "$('#refreshClientMessages').click()");
}
};
ajaxRenderer.addCallback(callback);
}

I put that in a request filter, but it didn't work, I am getting:

"Unexpected error: Page must be specified before initializing for partial page render."

I hope you have a better alternative.

Regards,
Matías.

Emmanuel DEMEY

necitită,
17 aug. 2012, 15:00:3417.08.2012
– tapestry...@googlegroups.com
You have this error when you visit for the firt time the page, or after the ajax request ?

2012/8/17 Matías Blasi <matias...@gmail.com>



--
Emmanuel DEMEY
Ingénieur Etude et Développement
ATOS Worldline
+33 (0)6 47 47 42 02
demey.e...@gmail.com

Twitter : @EmmanuelDemey

Matías Blasi

necitită,
17 aug. 2012, 16:23:0217.08.2012
– tapestry...@googlegroups.com
Thanks Emmanuel,

I have this problem in every ajax call.

The problem is because I am doing that in the filter before calling handler.service(...).

Anyway, by refreshing the zone which wraps jGrowl, is not enough for getting the messages... I would need to add every new message, for example through 'addjGrowlAlert'... I tryied to do that, using the ajaxResponseRenderer, but it has no effect calling it after the service handling...

I really don't know which would be the best way...

Regards,
Matías.

Matías Blasi

necitită,
18 aug. 2012, 11:52:2918.08.2012
– tapestry...@googlegroups.com
I solved it by advising my messageing service, and every time I add a message, I set an ajax callback in the AjaxResponseRenderer to add this new message through jGrowl (ony in ajax cases).

Thanks a lot!

Regards,
Matías.

Iván Sixto López

necitită,
9 ian. 2015, 07:36:2109.01.2015
– tapestry...@googlegroups.com
Could you please put an example? :S
Răspundeți tuturor
Răspundeți autorului
Redirecționați
0 mesaje noi