Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: Components/Renderers
    • Labels:
      None

      Description

      this is typical implementation of custom component's method:

      MyComponent.java
      MyComponent.processDecodes:
      
      if (!isRendered()) {
        return;
      }
      super.processDecodes(context);
      // do specific stuff
      
      

      If MyComponent extends UIInput, then if component has ValueExpression for "rendered" (and VE resolves to true), it is evaluated 3x:

      1. MyComponent.processDecodes
      2. javax.faces.component.UIInput.processDecodes(FacesContext)
      3. javax.faces.component.UIComponentBase.processDecodes(FacesContext)


      Suggestion:
      add a useful return value for execute and render lifecycle methods like visitTree has already. Then code can be optimized:

      MyComponent.java
      MyComponent.processDecodes:
      
      
      if (!super.processDecodes(context))
       return;
      
      // do specific stuff
      

      Considerations:

      • Blake's Axiom of Boolean Properties: You will regret making your property a boolean (http://www.mail-archive.com/dev@myfaces.apache.org/msg52753.html). Create new Enum or reuse existing VisitResult as return value
      • if change to exiting API is not possible, add new method like "UIComponent.isXYZPhaseExecutable"
      • if change to API is not possible at all, find a way similar as ELContext.setPropertyResolved(boolean): a property on context "current execute/render method is executable on this component"

        Activity

        Hide
        Manfred Riem added a comment -

        Setting priority to Minor

        Show
        Manfred Riem added a comment - Setting priority to Minor
        Hide
        Ed Burns added a comment -

        Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

        Show
        Ed Burns added a comment - Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

          People

          • Assignee:
            Unassigned
            Reporter:
            Martin Kočí
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: