1

I'm using JSF and making a webapp. I succeeded to assign a value to a variable in normal xhtml page, but not in a page where i have a datatable of primefaces. Biding doesnt work so search has to be null. Here is my code.

<p:dataTable id="examplej" class="table couple-table" 
                     var="info" value="#{bb.coupleList}" rows="10" paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
                     rowsPerPageTemplate="5,10,15" paginator="true" emptyMessage="お探しの地域では見つかりませんでした">
            <f:facet name="header">
                <p:outputPanel>
                    <h:outputText value="地域で検索" />


                    <br/>     <br/>
                    <p:inputText id="search" value="#{bb.search}" style="width:150px" p:placeholder="例:世田谷区"/>

                    <h:commandLink type="submit" value="地域で検索" action="#{bb.filterTable}" class="Button"/>

                </p:outputPanel>

            </f:facet>
            <p:ajax event="rowSelect" listener="#{bb.detail(info)}"
                    />
//left out


        </p:dataTable>

search is null in this method.

public String filterTable() {
    System.out.println("filterTable()");
    System.out.println("search in filterTable() = " + search);
    Flash flash = FacesContext.getCurrentInstance()
            .getExternalContext().getFlash();
    flash.put("search", search);
    System.out.println("search in filterTable in Bb = " + search);
    return "filtered-table.xhtml";
}

Thank you in advance.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
anonyrabbit
  • 179
  • 1
  • 3
  • 12
  • 1
    this helped. http://stackoverflow.com/questions/2118656/commandbutton-commandlink-ajax-action-listener-method-not-invoked-or-input-value/2120183#2120183 – anonyrabbit Jan 04 '17 at 16:21
  • Great it works. Then please remove your question if the duplicate helped and there is no additional info – Kukeltje Jan 04 '17 at 18:13

0 Answers0