javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-1223

Facelet ui:param doesn't work in composite components (action)

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      If i have a facelet file which includes a composite component and I want to pass ui:params for the action it doesn't work

      File a.xhtml includes my template myTemplate.xhtml. I want to pass parameters for an action

      <ui:include src="/pages/templates/myTemplate.xhtml">
            <ui:param name="resetAction" value="reset" />
            <ui:param name="bean" value="#{myBean}" />
      </ui:include>
      

      Following works / works not in myTemplate.xhtml:

      value is displayed

      <h:outputText value="Bean: #{bean}" />
      

      value is displayed

      <h:outputText value="resetAction: #{resetAction}" />
      

      Action doesn't work if i pass it into a compositeComponent

      <myCom:reset resetAction="#{bean[resetAction]}" />
      

      for a commandButton it works.

      <p:commandButton value="test reset" action="#{bean[resetAction]}" />
      

      If I don't add my composite component to a facelet tempalte the action also works:

      <myCom:reset resetAction="#

      {myBean.reset}

      " />

        Issue Links

          Activity

          Hide
          Manfred Riem added a comment -

          Can you send the entire reproducer (including all the sources) to issues@javaserverfaces.java.net?

          Show
          Manfred Riem added a comment - Can you send the entire reproducer (including all the sources) to issues@javaserverfaces.java.net?
          Hide
          dasago added a comment -

          I send you an example project.. (maven based, JBoss 6.0 Final, Mojarra 2.1.17, PrimeFaces 3.5, Omnifaces 1.4.1)

          First example in reset page works - pass values directly to composite component

          Second example in reset page doesn't work - pass values via facelet file to composite component

          Third example in reset page works - pass values via facelet file to composite component with a workaround of omnifaces

          Show
          dasago added a comment - I send you an example project.. (maven based, JBoss 6.0 Final, Mojarra 2.1.17, PrimeFaces 3.5, Omnifaces 1.4.1) First example in reset page works - pass values directly to composite component Second example in reset page doesn't work - pass values via facelet file to composite component Third example in reset page works - pass values via facelet file to composite component with a workaround of omnifaces
          Hide
          Manfred Riem added a comment -

          You have hit upon an area with respect to composite components and ui:include that has not been ironed out as much as needed. The problem is that the context of the ui:param is not available within a retargetted expression that the action needs to actually work.

          I am moving this to the spec issue tracker as the real issue still exists.

          Show
          Manfred Riem added a comment - You have hit upon an area with respect to composite components and ui:include that has not been ironed out as much as needed. The problem is that the context of the ui:param is not available within a retargetted expression that the action needs to actually work. I am moving this to the spec issue tracker as the real issue still exists.
          Hide
          Thomas Lee added a comment -

          This is probably a better description of the JAVASERVERFACES_SPEC_PUBLIC-1222 issue I filed. Being a POJO or a managed bean is unrelated if I recall correctly.

          I've been working around this by placing the ui:param in the view outside of the ui:include so that evaluations can find the ui:param correctly.

          <ui:param name="pojoOrManagedBean" value="#{bean}"/>
          <ui:include src="innerPageWithCompositeComponentWithTarget"/>
          
          Show
          Thomas Lee added a comment - This is probably a better description of the JAVASERVERFACES_SPEC_PUBLIC-1222 issue I filed. Being a POJO or a managed bean is unrelated if I recall correctly. I've been working around this by placing the ui:param in the view outside of the ui:include so that evaluations can find the ui:param correctly. <ui:param name= "pojoOrManagedBean" value= "#{bean}" /> <ui:include src= "innerPageWithCompositeComponentWithTarget" />
          Hide
          Ed Burns added a comment -

          Manfred, do you think we can close 1222 as a duplicate of this one?

          Ed

          Show
          Ed Burns added a comment - Manfred, do you think we can close 1222 as a duplicate of this one? Ed
          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.
          Hide
          Manfred Riem added a comment -

          Setting priority to Major

          Show
          Manfred Riem added a comment - Setting priority to Major

            People

            • Assignee:
              Unassigned
              Reporter:
              dasago
            • Votes:
              4 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated: