データテーブルの検索機能を実装したいのですが、肝心のfilterTable()メソッドが動かず、filtered-table.xhtmlへと移動できません。メソッドにsystem.out.printを書いたのですがサーバログにも変化がないです。なぜだかお分かりになる方がいたら回答の方よろいくお願いします。
テンプレート機能を利用しています。
xhtml
1 <h:body> 2 <ui:composition> 3 <link rel="stylesheet" type="text/css" href="resources/css/find.css" /> 4 <h:outputStylesheet library="css" name="find.css" /> 5 6 7 8 <h:form> 9 <br/> 10 <p:inputText id="globalFilter" value="#{bb.search}" style="width:150px" placeholder="Enter keyword"/> 11 12 <h:commandButton value="検索" action="#{bb.filterTable()}" class="Button"/> 13 <br/> 14 <br/> <br/> 15 <br/> <br/> 16 </h:form> 17 18 <p:dataTable id="examplej" class="table table-striped table-bordered dt-responsive nowrap table-hover" 19 var="info" value="#{bb.coupleList}" rows="10" paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}" 20 rowsPerPageTemplate="5,10,15" paginator="true" emptyMessage="お探しの地域では見つかりませんでした"> 21 <f:facet name="header"> 22 <p:outputPanel> 23 <h:outputText value="Search all fields:" /> 24 </p:outputPanel> 25 26 </f:facet> 27 28 <p:column> 29 <p:graphicImage value="#{bb.pic}" > 30 <f:param name="id" value="#{info.id}"/> 31 </p:graphicImage> 32 </p:column> 33 34 <p:column> 35 <h:outputText value="#{info.addressOne}" /> 36 </p:column> 37 38 39 <p:column> 40 <h:outputText value="#{info.firstName}" />さん 41 </p:column> 42 43 44 45 <p:column> 46 <h:commandLink action="#{bb.detail(info)}"> 47 詳細へ 48 </h:commandLink> 49 </p:column> 50 51 52 </p:dataTable> 53 54 55 </ui:composition> 56 57 </h:body>
Java
1 public String filterTable() { 2 System.out.println("filterTable()"); 3 Flash flash = FacesContext.getCurrentInstance() 4 .getExternalContext().getFlash(); 5 flash.put("search", this.search); 6 return "filtered-table.xhtml"; 7 }
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。