webtier@glassfish.java.net

Re: [webtier] Re: ValueChangeListeners+ajax

From: Jim Driscoll <Jim.Driscoll_at_Sun.COM>
Date: Tue, 28 Jul 2009 09:24:22 -0700

My initial proposal allowed for that, but the EG shot that down. Too
complicated (though not that complicated).

But I'm confused why you need to call statusUpdate in all cases.

If !dirty, then you've already called the request, so why on earth call
it again? Is there a reason I'm missing?

Otherwise, use a different source dom object, and screen on that.

Jim

On 7/28/09 9:05 AM, webtier_at_javadesktop.org wrote:
> Is there a way to remove a listener function? My code below is an endless loop, because jsf.ajax.request invokes the statusUpdate, and statusUpdate calls sf.ajax.request.
>
> var statusUpdate = function statusUpdate(data) {
> var hDirty = document.getElementById("dirty");
> if(data.type == "event"&& data.status == "success") {
> if(hDirty.value == "true") {
> if(confirm('Unsaved data! Cancel?')) {
> jsf.ajax.request(data.source, null, {render: 'dataTable'});
> }
> } else {
> jsf.ajax.request(data.source, null, {render: 'dataTable'});
> }
> }
> };
>
> jsf.ajax.addOnEvent(statusUpdate);
>
> So, before jsf.ajax.request, i want to remove the listener, and reattach after .
> [Message sent by forum member 'gabox01' (gabox01)]
>
> http://forums.java.net/jive/thread.jspa?messageID=357914
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>