ICEfaces
  1. ICEfaces
  2. ICE-8459

ace:dataTable - commandButton in columnGroup header does not work

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: EE-3.0.0.GA_P01, 3.2
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      All
    • Workaround Exists:
      Yes
    • Workaround Description:
      Hide
      Include the commandButton in the header facet.

      <ace:column>
           <f:facet name="header">
                <h:commandButton>
                     <f:ajax>
                </h:commandButton>
           </f:facet >
      </ace:column>
      Show
      Include the commandButton in the header facet. <ace:column>      <f:facet name="header">           <h:commandButton>                <f:ajax>           </h:commandButton>      </f:facet > </ace:column>

      Description

      If an h:commandButton is used in an ace:column that is defined in a columnGroup, the button action/actionListener is not called.

      Sample code:

      <ace:dataTable>
           <ace:columnGroup type="header">
                <ace:row>
                     <ace:column>
                          <h:commandButton>
                               <f:ajax>
                          </h:commandButton>
                     </ace:column>
                </ace:row>
           </ace:columnGroup>
           ....
      </ace:dataTable

        Activity

        Hide
        Arran Mccullough added a comment -

        Attached test case that shows issue.

        Steps:

        • Load welcomeICEfaces.jsf
        • Clicking on "Working" button will show output in server logs.
        • Clicking on "Broken" button will show nothing.
        Show
        Arran Mccullough added a comment - Attached test case that shows issue. Steps: Load welcomeICEfaces.jsf Clicking on "Working" button will show output in server logs. Clicking on "Broken" button will show nothing.
        Hide
        Nils Lundquist added a comment -

        worth noting that this is only if f:ajax is used- a regular action listener on that button works as expected.

        Show
        Nils Lundquist added a comment - worth noting that this is only if f:ajax is used- a regular action listener on that button works as expected.
        Hide
        Nils Lundquist added a comment -

        looking through the UIComponentBase implementation of f:ajax events, the components themselves are responsible for state saving the behaviors objects that are attached to them (unclear about when this occurs), rather inspecting the component tree for attached f:ajax component objects. My guess is that this is the failure point that makes this case differ from the plain actionListener case. I am investigating further.

        Show
        Nils Lundquist added a comment - looking through the UIComponentBase implementation of f:ajax events, the components themselves are responsible for state saving the behaviors objects that are attached to them (unclear about when this occurs), rather inspecting the component tree for attached f:ajax component objects. My guess is that this is the failure point that makes this case differ from the plain actionListener case. I am investigating further.
        Hide
        Nils Lundquist added a comment -

        ICE-8459 - Fixed ColumnGroup column children excluded in DataTable visitTree.

        Previously only column header facets defined in the header ColumnGroup were rendered, and as such were the only subcomponent visited.

        Revision #30513
        Committed by nils.lundquist
        A minute ago
        ICE-8459 - Fixed ColumnGroup column children excluded in visitTree.

        Show
        Nils Lundquist added a comment - ICE-8459 - Fixed ColumnGroup column children excluded in DataTable visitTree. Previously only column header facets defined in the header ColumnGroup were rendered, and as such were the only subcomponent visited. Revision #30513 Committed by nils.lundquist A minute ago ICE-8459 - Fixed ColumnGroup column children excluded in visitTree.
        Hide
        Nils Lundquist added a comment -

        ICE-8459 - Backported fix to ace:dataTable visitTree.

        Show
        Nils Lundquist added a comment - ICE-8459 - Backported fix to ace:dataTable visitTree.
        Hide
        Evgheni Sadovoi added a comment -

        I am adding this comment for the sake of completeness.

        The workaround provided above have a limitation. It will not be functional if we need to re-render and execute more then 1 component upon button click.
        If you extend <f:ajax /> to <f:ajax execute="@all" render="@all" /> the button will stop working again.
        If you reduce it to <f:ajax render="@all" /> the button will work but then we have another problem: Only the button gets executed which means the rest of the viewstate (inputtexts etc.) will be ignored.

        To overcome this difficulty the following approach must be taken:

        <f:facet name="header">
        <h:commandButton value="Broken" actionListener="#

        {testBean.test2}

        ">
        <f:ajax render="@all" execute="#

        {testBean.fullyQualfiedComponentNames}

        "/>
        </h:commandButton>
        </f:facet>

        In other words instead of using @all in execute parameter of the f:ajax tag you'll need to use id's of the components and/or containers which you need to run through JSF lifecycle. Here fullyQualfiedComponentNames variable will resolve to the following upon bean construction: fullyQualfiedComponentNames = ":myFormId:myComponentId :myFormId:myContainerId:myComponent2Id @this";

        Show
        Evgheni Sadovoi added a comment - I am adding this comment for the sake of completeness. The workaround provided above have a limitation. It will not be functional if we need to re-render and execute more then 1 component upon button click. If you extend <f:ajax /> to <f:ajax execute="@all" render="@all" /> the button will stop working again. If you reduce it to <f:ajax render="@all" /> the button will work but then we have another problem: Only the button gets executed which means the rest of the viewstate (inputtexts etc.) will be ignored. To overcome this difficulty the following approach must be taken: <f:facet name="header"> <h:commandButton value="Broken" actionListener="# {testBean.test2} "> <f:ajax render="@all" execute="# {testBean.fullyQualfiedComponentNames} "/> </h:commandButton> </f:facet> In other words instead of using @all in execute parameter of the f:ajax tag you'll need to use id's of the components and/or containers which you need to run through JSF lifecycle. Here fullyQualfiedComponentNames variable will resolve to the following upon bean construction: fullyQualfiedComponentNames = ":myFormId:myComponentId :myFormId:myContainerId:myComponent2Id @this";

          People

          • Assignee:
            Nils Lundquist
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: