Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-3065

Ajax listeners don't fire for components in header facet of accordion/tabView

    Details

      Description

      Steps to reproduce:

      1. Create a webapp with the following contents:
        index.xhtml:
         <alloy:form>
             <alloy:accordion value="#{bean.items}" var="item">
                 <alloy:tab>
                     <f:facet name="header">
                         <alloy:outputText value="heading #{item}" />
                         <alloy:selectBooleanCheckbox>
                             <f:ajax listener="#{bean.clickListener}" />
                         </alloy:selectBooleanCheckbox>
                     </f:facet>
                     <alloy:outputText value="content #{itemp}" />
                 </alloy:tab>
             </alloy:accordion>
         </alloy:form>
        

        Bean.java:

         @ManagedBean
         @RequestScoped
         public class Bean {
             public void clickListener(AjaxBehaviorEvent ajaxBehaviorEvent) {
                 FacesRequestContext.getCurrentInstance().addScript(FacesContext.getCurrentInstance(),
                     "alert('" + ajaxBehaviorEvent.getComponent().getClientId() + " clicked');");
             }
             public List<String> getItems() {
                 List<String> items = new ArrayList<String>();
                 items.add("1");
                 items.add("2");
                 items.add("3");
                 return items;
             }
         }
        
      2. Click one of the checkboxes in the header.

      If the bug still exists, no alert will appear.

      If the bug is fixed, an alert will appear showing which element was clicked.

      Notes

      Clicking the element will still cause an ajax request/response, but along with listeners not firing, render="@this" and render="id" also don't seem to work. However, render="@form" does work correctly.

      Potential Workaround

      Depending on what you are trying to accomplish, alloy:accordion's tabExpand and tabCollapse ajax events and alloy:tabView's tabSelect ajax event could potentially be used instead of a button/checkbox etc. with a click/valueChange event.

        Attachments

          Activity

            People

            Assignee:
            neil.griffin Neil Griffin
            Reporter:
            kyle.stiemann Kyle Stiemann (Inactive)
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:

                Packages

                Version Package
                alloy-3.2.0-new-features