ICEfaces
  1. ICEfaces
  2. ICE-6693

tabSet label facets causing facelets error in development staging

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: EE-2.0.0.GA
    • Fix Version/s: 3.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      jsf2.1.1-b03, ICEfaces2, ace
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      to get rid of the facelets error message, place the application in Production Stage with the following entry in web.xml:-
      <context-param>
            <param-name>javax.faces.PROJECT_STAGE</param-name>
             <param-value>Production</param-value>
      </context-param>
      Show
      to get rid of the facelets error message, place the application in Production Stage with the following entry in web.xml:- <context-param>       <param-name>javax.faces.PROJECT_STAGE</param-name>        <param-value>Production</param-value> </context-param>

      Description

      The following message appears with ace-showcase example page of Server side with facets for labels when the application is in development stage:-

      The form component needs to have a UIForm in its ancestry. Suggestion: enclose the necessary components within <h:form>

      This does not affect functionality or styling, but could become a problem if developer's are trying to use development staging with these features and testing something like security.

      Workaround is to switch web.xml for Production jsf staging, but it appears that the problem occurs when adding the label facets to the component tree.

      jsf code is in jsf-ri/src/main/java/com/sun/faces/facelets/tag/jsf/ComponentTagHanderlDelegateImpl.java:-

              addComponentToView(ctx, parent, c, componentFound);
               adjustIndexOfDynamicChildren(context, c);
              if (context.isProjectStage(ProjectStage.Development)) {
                  ComponentSupport.addMissingFormMessageIfNecessary(context, c);
              }

      which is called when checking the parent of a component that is added to the tree (used to look for HtmlForm now looks for UIForm):_
      jsf-ri/src/main/java/com/sun/faces/facelets/tag/jsf/ComponentSupport.java

        * method to inspect of the the parent ancestry of the component.
      + * contains UIForm as one of the ancestors.
            * @param component
      + * @return true of UIForm is one of the ancestors
            */

        private static boolean inspectParentAncestryToCheckIfFormOmitted(UIComponent component) {
               if (component != null) {
                   while (!(component instanceof UIViewRoot) && component != null) {
                       if (component instanceof UIForm ||
                           component instanceof UINamingContainer) {
                           return true;

       Something about adding the label facets or the components within the label facets is causing this to throw true.
           private static boolean inspectParentAncestryToCheckIfFormOmitted(UIComponent component) {
               if (component != null) {
                   while (!(component instanceof UIViewRoot) && component != null) {
      - if (component instanceof HtmlForm ||
      + if (component instanceof UIForm ||
                           component instanceof UINamingContainer) {
                           return true;
                       }




        Activity

        Show
        Judy Guglielmin added a comment - Links to relevant jsf Issues:- http://java.net/jira/browse/JAVASERVERFACES-1922 http://java.net/jira/browse/JAVASERVERFACES-1663
        Hide
        Ken Fyten added a comment -

        This is due to Mojarra JSF bugs and there is an easy work-around. Won't Fix.

        Show
        Ken Fyten added a comment - This is due to Mojarra JSF bugs and there is an easy work-around. Won't Fix.

          People

          • Assignee:
            Unassigned
            Reporter:
            Judy Guglielmin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: