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

Richfaces scrollableDataTable header disappears after sending ajax request and re-render the scrollableDataTable in IE7

    Details

      Description

      Richfaces scrollableDataTable's header disappears after sending ajax request and re-render the scrollableDataTable IE7. The cause has been identified to be that the client view id has a prefix "_" that blows off the IE7 browser.

      There was a workaround that uses a customized javax.faces.ViewRoot to overwrite the default one used by Portlet Bridge. Defining the following in the faces-config.xml:
      <component>
      <component-type>javax.faces.ViewRoot</component-type>
      <component-class>
      yourpackage.UIPortletAjaxViewRoot
      </component-class>
      </component>
      In the class yourpackage.UIPortletAjaxViewRoot a different prefix, for example "pb" was used instead of "_".

      This workaround only works for Portlet Bridge 1.0.x.

      After migrating to Portlet Bridge 2.0.0.FINAL(2.0.0.FINAL-CP05) the workaround doesn't work any more.

      I've tried to modify the following code in the class org.jboss.portletbridge.component.UIPortletViewRoot:

      public static String convertClientId(FacesContext context, UIViewRoot root, String additionalId)
      {
      ExternalContext ec = context.getExternalContext();
      String namespace = ec.encodeNamespace(SEPARATOR);

      /*

      • In servlet world encodeNamespace does nothing – so if we get back what we sent in then do
      • not perturn the NamingContainer Id
        *
      • The "_" was added for LifeRay compatibility
        */
        if (namespace.length() > 1)
        Unknown macro: { if (additionalId != null) { return "_"+namespace + additionalId; } else { return "_"+namespace; } }

        else

        { return additionalId; }
        }

        to

        public static String convertClientId(FacesContext context, UIViewRoot root, String additionalId)
        {
        ExternalContext ec = context.getExternalContext();
        String namespace = ec.encodeNamespace(SEPARATOR);

        /*
        * In servlet world encodeNamespace does nothing – so if we get back what we sent in then do
        * not perturn the NamingContainer Id
        *
        * The "_" was added for LifeRay compatibility
        */
        if (namespace.length() > 1)
        {
        if (additionalId != null)
        { return "pb"+namespace + additionalId; }
        else
        { return "pb"+namespace; }
        }
        else
        { return additionalId; }

        }

      The aforementioned issue goes away after this fix.

      I also notice that there's another class javax.portlet.faces.component.PortletNamingContainerUIViewRoot in the Portlet Bridge 2.0.0.FINAL that uses "_" as prefix but this class is not used anywhere in the code.

      Will the fix above bring any side effect?

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                wesleyhales Wesley Hales
                Reporter:
                ghjboss Gary Hu
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: