Pergunta

I have popupPanel with a simple form (for search) and a dataTable (for search results). I try to Rerender the dataTable after submitting the form and populating the search results which fails. Here is the source code

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:rd2="http://www.logica.com/raindance/webcomp"
    xmlns:a4j="http://richfaces.org/a4j" template="/layout/template.xhtml">

    <ui:define name="head">

    </ui:define>
    <ui:define name="body" >


    .......................................


    <rich:popupPanel id="ruleSearchPanel" width="600" lenght="400" autosized="true">
            <f:facet name="header">
                <h:panelGroup id="modelPanelHeader">                    
                    <h:outputText styleClass="modalpanel-header"
                        value="Search and select a rule set"></h:outputText>
                </h:panelGroup>
            </f:facet>

            <h:form id="searchForm">                
                <h:panelGrid columns="2" styleClass="center" width="100%">
                    <h:inputText id="searchForKey" value="#{authRuleRegisterManager.rulSetSearchCriteria}"/>                    
                    <a4j:commandButton id="SearchRuleSets" styleClass="plain-btn fright" reRender="ruleSearchPanel"
                            value="#{messages.search}" type="submit" action="#{authRuleRegisterManager.searchAuthRulesMap(authRuleRegisterManager.rulSetSearchCriteria)}"
                    />                                  
            </h:panelGrid>      

        <rich:extendedDataTable  id="resultRuleSets" 
            value="#{authRuleRegisterManager.searchResultsForAuthRuleSets}" selectedClass="active-row"
            rows="#{systemSettingsAction.systemSettings.paginationRows.value}"
            var="ruleSet" 
            rowClasses="odd-row-selectable,even-row-selectable" 
            selectionMode="single">

            <rich:column  label="ruleset name"
                 headerClass="left"
                 styleClass="left" width="70">
                <f:facet name="header">
                    <h:outputText value="name" styleClass="right" />
                </f:facet>
                <h:outputText value="#{ruleSet.description}" />
            </rich:column>
        </rich:extendedDataTable>                   
            </h:form>    
    </rich:popupPanel>          
        </ui:define>
    </ui:composition>

why I cannot rerender my datatable , do I miss something here? any help will be appreciated.

Foi útil?

Solução

There is no reRender attribute for <a4j:commandButton> for the version you are using. You can check the tag reference below

a4j:commandButton.

Based on the code I'm seeing (ui:composition not taken into account), if you want to update the dataTable simply change

reRender="ruleSearchPanel"

to

render ="searchForm:resultRuleSets"

If you are confused about determining ids check the link below

How can I know the id of a JSF component so I can use in Javascript

Note: Some of the attributes that you are using are not defined in some of the components that you are using. For example

lenght for rich:popupPanel

selectedClass for rich:extendedDataTable

label for rich:column

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top