I
I
InPizzaWeTrust2021-01-06 14:36:58
Java
InPizzaWeTrust, 2021-01-06 14:36:58

How to activate the filter checkbox by clicking on the text?

There is a search in the project, where you can turn off various filters. At the moment, filters are activated by clicking on the checkbox itself. You need to make sure that the filters are activated by clicking on the text as well.

<p:dataTable id="themeManyChkBx"
   rows="#{researchController.themeRowsCount}"
                                         emptyMessage="#{messages['views.common.TableEmptyMessage']}"
                                         styleClass="gridWithoutHeader search-filter-item"
                                         lazy="true"
                                         var="theme"
                                         rowKey="#{theme.name}"
                                         paginatorPosition="bottom"
                                         value="#{researchController.themes}"
                                         selection="#{researchController.actualThemes}">
                                <p:ajax event="rowSelectCheckbox"   listener="#{researchController.themeSelected}"
                                        update="mainView:findForm:scroller, mainView:findForm:selectedFilterPanel, mainView:findForm:rowCount, mainView:findForm:yearPanel, mainView:findForm:themePanel, mainView:findForm:customerPanel"/>
                                <p:ajax event="rowUnselectCheckbox" listener="#{researchController.themeSelected}"
                                        update="mainView:findForm:scroller, mainView:findForm:selectedFilterPanel, mainView:findForm:rowCount, mainView:findForm:yearPanel, mainView:findForm:themePanel, mainView:findForm:customerPanel"/>
                                <f:facet name="header" class="search-results-header"/>
                                <p:column selectionMode="multiple" style="width:16px;text-align:center"/>
                                <p:column rendered="#{dictionariesHolderBean.findThemeById(theme.name) ne null}">
                                    <h:outputText
                                        value="#{localeBean.getLocaleName(dictionariesHolderBean.findThemeById(theme.name))}">
                                </h:outputText>
                                    <h:outputLabel>
                                        <h:outputText value="#{'('+=theme.rowCount+=')'}" class="count-number"/>
                                    </h:outputLabel>


I am attaching a piece of code where it is required to be implemented. I understand that you need to dig into xhtml.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
InPizzaWeTrust, 2021-01-18
@InPizzaWeTrust

It was necessary to add additional events:
p:ajax event="rowSelect"
p:ajax event="rowUnselect"
and add the parameter "rowSelectMode="toggle"" to the dataTable field

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question