Uploaded image for project: 'RichFaces'
  1. RichFaces
  2. RF-13042

Render h:commandlink: keeps reloading js

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Duplicate Issue
    • Affects Version/s: 4.2.3.Final, 4.3.2
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      Use following page:

       
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE html>
      <html xmlns="http://www.w3.org/1999/xhtml" 
          xmlns:h="http://java.sun.com/jsf/html" 
          xmlns:rich="http://richfaces.org/rich"
          xmlns:a4j="http://richfaces.org/a4j">
          
          <h:head>
              <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
              
              <h:outputScript name="jquery.js"/>
       
              <title>Test Face</title>
          </h:head>
          <h:body>
          
              <h:form prependId="false">
                  <a4j:poll limitRender="true" interval="1000" render="content" status="null" enabled="true"/>
                            
                  <h:panelGroup id="content">
                      <h:commandLink immediate="true" action="#{testFace.action}" title="action">
                          <h:outputText value="edit"/>
                      </h:commandLink>
                  </h:panelGroup>
              </h:form>
          </h:body>
      </html>
      

      Running this keeps reloading the packed.js at each poll event. After 10 sec, my FF eats one entire CPU and becomes irresponsive. I also tried to disable the resource optimization with the same behavior (except that jsf.js is reloaded instead of packed.js)

      If I replace the h:commandlink by a a4j:commandlink, the problem disapear.

      The problem is the same with any render event, not only with the poll.

      Show
      Use following page: <? xml version = "1.0" encoding = "UTF-8" ?> <!DOCTYPE html> < html xmlns = "http://www.w3.org/1999/xhtml" xmlns:h = "http://java.sun.com/jsf/html" xmlns:rich = "http://richfaces.org/rich" xmlns:a4j = "http://richfaces.org/a4j" > < h :head> < meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" /> < h :outputScript name = "jquery.js" />   < title >Test Face</ title > </ h :head> < h :body> < h :form prependId = "false" > < a4j :poll limitRender = "true" interval = "1000" render = "content" status = "null" enabled = "true" /> < h :panelGroup id = "content" > < h :commandLink immediate = "true" action = "#{testFace.action}" title = "action" > < h :outputText value = "edit" /> </ h :commandLink> </ h :panelGroup> </ h :form> </ h :body> </ html > Running this keeps reloading the packed.js at each poll event. After 10 sec, my FF eats one entire CPU and becomes irresponsive. I also tried to disable the resource optimization with the same behavior (except that jsf.js is reloaded instead of packed.js) If I replace the h:commandlink by a a4j:commandlink, the problem disapear. The problem is the same with any render event, not only with the poll.

      Description

      Javascript resource is reloaded at each render, and so javascript was becoming heavier and heavier to run (to end by a not responsive alter on FF -or even FF hangs forever).

      After more investigation, I noticed it is due to the h:commandlink tag which was inside my rerendered part.

      Workaround:

      Add:

       
      <h:inputText rendered="false">
      <f:ajax />
      </h:inputText>
      

      in your page, Js is not reloading anymore. (I inserted it at the end but I guess it works anywhere)

      See forum link for more details.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  lfryc Lukáš Fryč
                  Reporter:
                  multanis Nicolas Daniels
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - 2 hours
                    2h
                    Remaining:
                    Remaining Estimate - 2 hours
                    2h
                    Logged:
                    Time Spent - Not Specified
                    Not Specified