Details
-
Type: Bug
-
Status: Closed
-
Priority: 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:
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
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
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">
{testBean.test2}<h:commandButton value="Broken" actionListener="#
">
{testBean.fullyQualfiedComponentNames}<f:ajax render="@all" execute="#
"/>
</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";