7 Replies Latest reply on Aug 30, 2007 1:13 PM by sergeysmirnov

    Limiting AJAX region inside <f:view> </f:view>

    vukovicz

      The web content that I'm developing is placed inside <f:subview> </f:subview> of already existing page (<f:view> and </f:view> are already placed there). My problem is that the whole page gets reloaded with each a4j request, and not only the part that I would like to refresh. Is it possible to limit ajax region and not to have the whole page reloaded each time ?

        • 1. Re: Limiting AJAX region inside <f:view> </f:view>

          What is going to be reloaded on Ajax response has no relation with f:view, f:subview and a4j:region as well.
          So, it looks like you totally on the wrong way.

          Post the page code snippet.

          • 2. Re: Limiting AJAX region inside <f:view> </f:view>
            vukovicz

            Thx for a hint.

            Honestly, I'm confused now.
            I have done a lot of code snippets and nothing worked correctly.
            Can you tell me what exactly does relate to the region that will be reloaded upon Ajax response ?
            I have analysed the HTTP traffic with Ethereal and I saw that my Ajax request/response are handeled OK, but after that I get a couple of additional HTTP req/res where all other parts of my page get reloaded (e.g. all images)


            • 3. Re: Limiting AJAX region inside <f:view> </f:view>
              ilya_shaikovsky

              As Sergey asked - please paste some snippet to start conversation from and describe the case you need to complete with this code.

              • 4. Re: Limiting AJAX region inside <f:view> </f:view>
                vukovicz

                Hello,

                here is an example that doesn't work in my environment as I would like. The pageReloadCounter gets updated each time after "onkeyup" event is fired?! Any hints ?

                <f:view>
                <h:form>
                <h:panelGrid columns="2">
                <h:outputText value="Ajax test:" />
                <a4j:region selfRendered="true">
                <h:inputText id="inputText" value="#{Bean.text}">
                <a4j:support event="onkeyup" reRender="repeater" />
                </h:inputText>
                </a4j:region>

                <h:outputText value="Output Ajax text:" />
                <h:outputText value="#{Bean.text}" id="repeater" />

                <h:outputText value="Page reload counter:" />
                <h:outputText value="#{Bean.pageReloadCounter}" />

                </h:panelGrid>
                </h:form>
                </f:view>

                • 5. Re: Limiting AJAX region inside <f:view> </f:view>
                  ilya_shaikovsky

                  check please a4j:log that will give you a real info about client side reRendering.

                  Also descibe your JSF and RF versions.

                  • 6. Re: Limiting AJAX region inside <f:view> </f:view>
                    vukovicz

                    Hello,

                    here is log that I get for my page

                    -----------------------
                    debug[12:25:47,933]: Have Event [object Object] with properties: target: undefined, srcElement: [object], type: keyup
                    debug[12:25:47,933]: NEW AJAX REQUEST !!! with form :_id0
                    debug[12:25:47,948]: Append text control _id0:inputText with value [ertz] and value attribute [ertz]
                    debug[12:25:47,948]: Append hidden control oracle.adf.faces.FORM with value [_id0] and value attribute [_id0]
                    debug[12:25:47,948]: Append hidden control oracle.adf.faces.STATE_TOKEN with value [-73d51572] and value attribute [-73d51572]
                    debug[12:25:47,964]: parameter _id0:_id5 with value _id0:_id5
                    debug[12:25:47,964]: Start XmlHttpRequest
                    debug[12:25:47,979]: Reqest state : 1
                    debug[12:25:47,979]: QueryString: AJAXREQUEST=_id0%3A_id4&_id0%3AinputText=ertz&oracle.adf.faces.FORM=_id0&oracle.adf.faces.STATE_TOKEN=-73d51572&_id0%3A_id5=_id0%3A_id5&
                    debug[12:25:48,011]: Reqest state : 2
                    debug[12:25:48,011]: Reqest state : 3
                    debug[12:25:48,026]: Reqest state : 4
                    debug[12:25:48,026]: Reqest end with state 4
                    debug[12:25:48,026]: Response with content-type: text/html;charset=windows-1252
                    debug[12:25:48,042]: Full response content: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                    "http://www.w3.org/TR/html4/loose.dtd">
                    var _AdfWindowOpenError='A popup window blocker has been detected in your browser. Popup blockers interfere with the operation of this application. Please disable your popup blocker or allow popups from this site.';<form id="_id0" name="_id0" style="margin:0px" onkeypress="return _submitOnEnter(event,'_id0');" method="POST" action="/phonebook-admin/pages/Ajax_vuka.jsf">
                    LOG.registerPopup('L','LogWindow',800,600,LOG.ALL);
                    Ajax test:<input id="_id0:inputText" name="_id0:inputText" type="text" value="ertz" onkeyup="A4J.AJAX.Submit('_id0:_id4','_id0',event,{'parameters':{'_id0:_id5':'_id0:_id5'} ,'actionUrl':'/phonebook-admin/pages/Ajax_vuka.jsf'} )">
                    Output Ajax text:ertz
                    Page reloaded counter:5
                    function __id0Validator(){return true;}var _id0_SF={};_submitFormCheck();

                    debug[12:25:48,042]: Header Ajax-Response not found, search in
                    warn[12:25:48,058]: No ajax response header
                    debug[12:25:48,058]: Header Location not found, search in
                    -------------------------------

                    Can someone tell me what EXACTLY defines the AJAX region on a page that will be refreshed, without having the rest of the page refreshed too ?

                    regards
                    Zvonimir

                    • 7. Re: Limiting AJAX region inside <f:view> </f:view>

                      In the example about, using a4j:region is useless.