How limitRender works ?
fred-at-coding May 25, 2011 4:13 PMHi,
I having trouble using the partial rendering.
Here is the problem:
I've got two outputPanel. When I click (ajax) on a commandLink, instead of refreshing the correct panel, it refresh the all page.
The code is following.
The thing I wanted to do is simple: refresh only the affected panel, which lead to reduce the number of SQL query in the database, because each Managed Bean (MB_.....) is doing via EJB, some SQL query
Can you help me ? is there a solution ?
thanks !
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
>
<f:view contentType="text/html">
<h:head/>
<h:body>
<!-- ############# -->
<!-- Panel state -->
<!-- ############# -->
<rich:popupPanel id="statPane" autosized="true" modal="false">
<h:graphicImage name="6-1.gif" library="images"/>
Wait please...
</rich:popupPanel>
<a4j:status onstart="#{rich:component('statPane')}.show()" onstop="#{rich:component('statPane')}.hide()" />
<!-- ############# -->
<!-- Main table -->
<!-- ############# -->
<table>
<tr valign="top">
<td>
<a4j:outputPanel id="AuthorTest" layout="block">
<h:form>
<rich:dataTable id="AuthorTestTable" value="#{MB_Author.getAuthorList()}" var="author">
<rich:column>
<h:outputText value="#{author.firstname}"/>
</rich:column>
</rich:dataTable>
</h:form>
</a4j:outputPanel>
</td>
<td>
<a4j:outputPanel id="EditorTest" layout="block">
<h:form>
<rich:dataTable id="EditorTestTable" value="#{MB_Editor.getEditorList()}" var="editor">
<rich:column>
<h:outputText value="#{editor.name}"/>
</rich:column>
<rich:column>
<a4j:commandLink render="EditorTest" value="X" execute="@form" limitRender="true"/>
</rich:column>
</rich:dataTable>
</h:form>
</a4j:outputPanel>
</td>
</tr>
</table>
</h:body>
</f:view>
</html>