Uploaded image for project: 'Portlet Bridge'
  1. Portlet Bridge
  2. PBR-223

javax.faces.ViewState returns the same value for each portlets on one portal page when state saving method is set as "client".

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      When the state saving method is set as "client" two different portlets running on same portal page shows the exact same javax.faces.ViewState value, which might be causing one of our a4j:jsFunction not functioning properly.

      We placed alerts inside the script "rfResorg.ajax4jsf.javascript.AjaxScript.faces"
      (code snippet below) and found that problem is that the value of "options.parameters['org.ajax4jsf.portlet.NAMESPACE']" is coming as "undefined" and hence as per the line "anchor=namespace?window.document.getElementById(namespace):window.document;" the whole html document is being picked up for replacement of viewstate.

      *****************************************************************
      var namespace = options.parameters['org.ajax4jsf.portlet.NAMESPACE'];
      LOG.debug("Namespace for hidden view-state input fields is "+namespace);
      var anchor = namespace?window.document.getElementById(namespace):window.document;
      var inputs = anchor.getElementsByTagName("input");
      var newinputs = req.getElementsByTagName("input",idsSpan);
      A4J.AJAX.replaceViewState(inputs,newinputs);
      // For any cases, new state can be in uppercase element
      newinputs = req.getElementsByTagName("INPUT",idsSpan);
      A4J.AJAX.replaceViewState(inputs,newinputs);
      *****************************************************************

      It seems that Portlet A's view state is replaced by Portlet B's view state. As a result, an ajax request sent by Portlet A faces Portlet B's view state, which causes the failure of invoking Portlet A's server side method.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  alexsmirnov Alexander Smirnov
                  Reporter:
                  ghjboss Gary Hu
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: