Some more testing...

If I remove all the JS I posted before, then the common JSF button works, and obviously my ajaxed zone is ignored and the page is completely refresehd; if I add it again, then the common JSF does not work, and obviously the ajxed zone works great.

It's clear the problem comes with the JS and how does Ajaxanywhere handle the request...

2006/2/21, Enrique Medina <[EMAIL PROTECTED] >:
Hi again,

I have tried the solution you proposed about returning null for non-ajaxed requests, but I can't get it to work :-(

Here is my JS code:

ajaxAnywhere.getZonesToReload = function(url, submitButton)
                {
                    if (typeof submitButton != 'undefined')
                    {
                        if (submitButton.type == 'submit')
                        {
                            if ( submitButton.id.search('botonAjax') != -1)
                            {
                                return 'variablesSalidaList';
                            }
                        }
                    }
                   
                    return null;
                }

                ajaxAnywhere.formName = 'bodySubview:mainForm';
                ajaxAnywhere.substituteFormSubmitFunction ();
                ajaxAnywhere.substituteSubmitButtonsBehavior(true);

As you can see, I evaluate the ID of the submitButton to be something like *botonAjax*, so I can differentiate from the other buttons. And in any other case, I always return null. But when I press a button out of the ajaxed zone, it simply does nothing (well, the request is made, and the page is refreshed, but no navigation to the new page).

Any ideas of what could I be doing wrong? I'm convinced that maybe my problem has something to be with the JS code... or maybe not...


2006/2/21, Emmanuel Jay < [EMAIL PROTECTED]>:
Yes our app has ajaxed and non ajaxed part. For example some parts can't be ajaxed at all, such as the part using the fileUpload component (as well as any get operation for that matter).

Yes i use the link id to determine whether it is an Ajax request or not. Basically for a link it is:

var linkFrom = this.findForm().elements["mainForm:_link_hidden_"].value;

P.S. I have my own problem with AA, seems that the dataScroller doesn't work well with AA (if you ever come accross that case I'll be glad to hear if you manage to solve it!)


On 2/21/06, Enrique Medina < [EMAIL PROTECTED]> wrote:
Umm, I see. So your application has JSF pages with parts "ajaxed" and other parts, as usual JSF requests, don't you? I'll try it and let you know whether it finally works or not.

By the way, just for the sake of confirmation, is your JS code similar to mine? I mean, do you use the button or link ID to determine whether it's an "ajaxed" request or not?

Thanks very much for your support.


2006/2/21, Emmanuel Jay < [EMAIL PROTECTED]>:
I think the AA filter is totally by passed if the list of zones to reload is null (getZonesToReload returns null). In our app we mostly have links and returning null works fine.



On 2/21/06, Enrique Medina < [EMAIL PROTECTED]> wrote:
Null? I remember some tests returning '' and getting a NullPointerException. What should be the reason why returning NULL should work?

2006/2/21, Emmanuel Jay < [EMAIL PROTECTED]>:
Hi Enrique,

If you want you button or link action not to go through AA you have to return null for those in  getZonesToReload.

Hope that helps,

Emmanuel


On 2/21/06, Enrique Medina <[EMAIL PROTECTED]> wrote:
Hi,

Has anyone successfully used Ajaxanywhere inside a JSF page with a piece of the page being "ajaxed" and the other piece not? Let me give an example: imagine a JSF page where the selection of a combo box must force the refresh of another combo box. This zone is "ajaxed" using <aa:zoneJSF>. But buttons to save or go to another page in the navigation are not "ajaxed".

My problem is that the "ajaxed" zone works great, but then I have a button to save, and another one to navigate to another page, and those buttons don't seem to work. When I click them a request is sended, but none of their respective actions are executed, no error messages are shown (I have a global tag in the page). It seems like a request with an action returning simply null (not doing anything).

My _javascript_ for Ajaxanywhere looks like this:

ajaxAnywhere.getZonesToReload = function(url,submitButton)
{
    if (submitButton.id.equals('myAjaxButton')
        return "dataZone"; 

 
ajaxAnywhere.formName = "mainForm"; 
ajaxAnywhere.substituteFormSubmitFunction(); 
ajaxAnywhere.substituteSubmitButtonsBehavior(true); 

What am I doing wrong? How do you have to indicate non-ajaxed buttons in the getZonesToReload _javascript_ callback?







Reply via email to