rich:dataTable ajaxKeys="" method not called.
ratoo Sep 5, 2007 11:43 AMHello!
I'm trying to implement a asynchronously populated table.
The idea is to have a Bean with List<> of rows and Set as a keys for rows to be updated (inserted). the pool will update the table every second until the table is completely populated.
No luck so far :-(
Even the dataTable contains ajaxKeys="" the bean method is not called.
I have a button.
By pressing the button I show a modal panel with "please wait" and start a long process. Then I close a modal panel, but keep pooling until the table is populated (enabled="#{SearchForm.running}")
I don't want to repaint the whole table, so I suppose i can specify ajaxKeys as a set of newly populated rows (?).
here is the example:
... <a4j:outputPanel id="search_button"> Search: <h:inputText value="#{SearchForm.searchString}"/> <a4j:commandButton id="search" actionListener="#{SearchForm.search}" onclick="javascript:Richfaces.showModalPanel('search_mp', {left:'auto', top:'auto'})" oncomplete="Richfaces.hideModalPanel('search_mp');" value="search" reRender="search_list, search_timer"> </a4j:commandButton> <a4j:poll id="search_timer" reRender="search_list" interval="1000" ajaxSingle="true" enabled="#{SearchForm.running}"/> <rich:modalPanel id="search_mp" moveable="false" resizeable="false" width="220" height="40" zindex="2000"> <h:graphicImage value="/img/wait.gif" alt="please wait..."/> </rich:modalPanel> </a4j:outputPanel> <rich:tabPanel switchType="ajax"> <rich:tab label="Query Result"> <rich:dataTable id="search_list" value="#{SearchForm.results}" ajaxKeys="#{SearchForm.rowKeys}" var="result" style="width: 100%;"> <rich:column style="width: 100%; border: 0px none transparent"> <rich:simpleTogglePanel label="#{result.description}" switchType="ajax" ajaxSingle="true" opened="false"> <rich:dataTable value="#{result.resultList}" rendered="#{not empty result.resultList}" var="r" style="width: 100%"> <rich:column> <a4j:outputPanel style="width: 100%; height: 150px; overflow: auto; padding:2px;" layout="block"> <h:outputText value="#{result.htmlMap[r]}" style="width: 100%; height: 100%; text-align: left" escape="false"/> </a4j:outputPanel> </rich:column> </rich:dataTable> </rich:simpleTogglePanel> </rich:column> </rich:dataTable> </rich:tab> ...
full code :
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%> <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%> <f:subview id="search_page"> <a4j:outputPanel id="search_button"> Search: <h:inputText value="#{SearchForm.searchString}"/> <a4j:commandButton id="search" actionListener="#{SearchForm.search}" onclick="javascript:Richfaces.showModalPanel('search_mp', {left:'auto', top:'auto'})" oncomplete="Richfaces.hideModalPanel('search_mp');" value="search" reRender="search_list, search_timer"> </a4j:commandButton> <a4j:poll id="search_timer" reRender="search_list" interval="1000" ajaxSingle="true" enabled="#{SearchForm.running}"/> <rich:modalPanel id="search_mp" moveable="false" resizeable="false" width="220" height="40" zindex="2000"> <h:graphicImage value="/img/wait.gif" alt="please wait..."/> </rich:modalPanel> </a4j:outputPanel> <rich:tabPanel switchType="ajax"> <rich:tab label="Query Result"> <rich:dataTable id="search_list" value="#{SearchForm.results}" ajaxKeys="#{SearchForm.rowKeys}" var="result" style="width: 100%;"> <rich:column style="width: 100%; border: 0px none transparent"> <rich:simpleTogglePanel label="#{result.description}" switchType="ajax" ajaxSingle="true" opened="false"> <rich:dataTable value="#{result.resultList}" rendered="#{not empty result.resultList}" var="r" style="width: 100%"> <rich:column> <a4j:outputPanel style="width: 100%; height: 150px; overflow: auto; padding:2px;" layout="block"> <h:outputText value="#{result.htmlMap[r]}" style="width: 100%; height: 100%; text-align: left" escape="false"/> </a4j:outputPanel> </rich:column> </rich:dataTable> </rich:simpleTogglePanel> </rich:column> </rich:dataTable> </rich:tab> <rich:tab label="Log"> <rich:dataTable id="result_list" value="#{SearchResultList.list}" var="result" style="width: 100%;"> <rich:column style="border: 0px none transparent"> <h:selectBooleanCheckbox value="#{result.checked}"> <a4j:support event="onchange" reRender="logic"/> </h:selectBooleanCheckbox> </rich:column> <rich:column style="border: 0px none transparent"> <a4j:outputPanel id="logic"> <h:selectOneRadio value="#{result.logic}" required="false" style="text-align: center" rendered="#{result.checked}"> <f:selectItem itemLabel="OR" itemValue="OR" /> <f:selectItem itemLabel="AND" itemValue="AND" /> <f:selectItem itemLabel="NOT" itemValue="NOT" /> </h:selectOneRadio> </a4j:outputPanel> </rich:column> <rich:column style="width: 100%; border: 0px none transparent"> <rich:simpleTogglePanel label="#{result.description}" switchType="ajax" ajaxSingle="true" opened="false" style="background-color: #{result.checked ? 'CC33FF' : '#66CCFF'}"> <h:dataTable value="#{result.resultList}" rendered="#{not empty result.resultList}" var="r" > <h:column> <a4j:outputPanel style="padding:2px;" layout="block"> <h:outputText value="#{result.htmlMap[r]}" style="width: 100%; height: 100%; text-align: left" escape="false"/> </a4j:outputPanel> </h:column> </h:dataTable> </rich:simpleTogglePanel> </rich:column> </rich:dataTable> </rich:tab> </rich:tabPanel> </f:subview>