jsfbootsfaces

BootsFaces does not render area from ajax


I am trying to render a data table using ajax (BootsFaces) according to the values provided in the form. Unfortunately, desired part does not render. I can see the ajax request is going in the network tab, but it does not do anything (Area does not render and this searchPartialBean.getSearchList() method does not get called). Below is my code snippet. Is there any issue in the way I am doing it ?

<b:tab title="Search">
<h:form>
    <b:row>
        <b:column mediumScreen="7">
            <b:inputText placeholder="Telephone number" label="Telephone number"
                         value="#{searchPartialBean.telephoneNumber}"/>
            <b:inputText placeholder="First name" label="First Name"
                         value="#{searchPartialBean.firstName}"/>
            <b:inputText placeholder="Last name" label="Last Name"
                         value="#{searchPartialBean.lastName}"/>
            <b:commandButton look="primary" id="search-form-submit" value="Search"
                             update="serach-results-table"/>
        </b:column>
        <b:column mediumScreen="5">
            <b:alert severity="info" title="Info">
                This will contain the search help.
            </b:alert>
        </b:column>
    </b:row>
    <br />
    <b:panel id="serach-results-table">
        <b:dataTable rendered="#{searchPartialBean.valuesPresent}" value="#{searchPartialBean.getSearchList()}" var="patient">
            <b:dataTableColumn label="Date" value="#{patient.firstName}"/>
        </b:dataTable>
    </b:panel>
</h:form>
</b:tab>

Solution

  • You've wrapped a form in a tab. Both widgets define a namespace, which, in turn, adds a prefix to the id of each widget within. Probably that's the problem.

    My first approach would be to add a colon to indicate you're searching in the inner namespace:

    update=":search-results-table"
    

    If that doesn't work, you can use the recursive search expression of BootsFaces:

    update="**:search-results-table"
    

    However, my favorite approach is to use a CSS pseudo class like so:

    update="@(.search-results-table)"
    
    <b:panel styleClass="search-results-table">