Forums de discussion
LazyDataModel.findRows called recursievly from unrelated search field
Abey M, modifié il y a 7 années.
LazyDataModel.findRows called recursievly from unrelated search field
New Member Publications: 18 Date d'inscription: 20/01/12 Publications récentes
Hi,
I am using the Lazy data model for populating the ui table.
I noticed that when changing the value in start date in search criteria, the findRows method is recursively called, causing multiple calls to the backend before the values are set. This is causing heavy backend traffic and bugs.
How can I make icefaces to call findRows only on clicking the Search button?
Thank you.
The DTO class is
The xhtml is
I am using the Lazy data model for populating the ui table.
I noticed that when changing the value in start date in search criteria, the findRows method is recursively called, causing multiple calls to the backend before the values are set. This is causing heavy backend traffic and bugs.
How can I make icefaces to call findRows only on clicking the Search button?
Thank you.
The DTO class is
public class MyTO implements com.liferay.faces.util.model.LazyDataModel
...
@Override
public List<myto> findRows(int startRow, int finishRow) {
return service.geRecords(this, startRow,
(finishRow - startRow) + 1);
//return null;
}
...
}</myto>
The xhtml is
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:ace="http://www.icefaces.org/icefaces/components" xmlns:ice="http://www.icesoft.com/icefaces/component" xmlns:icecore="http://www.icefaces.org/icefaces/core">
<f:loadbundle basename="messages" var="msg" />
<h:head></h:head>
<h:body>
<ice:portlet>
<ice:outputstyle href="#{msg['icefaces.portlet.style.rime.css']}" />
<ice:outputstyle href="#{msg['icefaces.portlet.style.showcase.css']}" />
<ice:form>
<ice:panelgroup>
<ice:selectinputdate id="formStartDate" binding="#{myBean.startDateComp}" value="#{myBean.startDate}" renderaspopup="true" highlightclass="weekend" highlightunit="DAY_OF_WEEK" highlightvalue="1,7" label="#{msg['my.search.form.field.startdate.text']}">
<f:convertdatetime pattern="#{msg['my.form.date.format']}" timeZone="#{msg['my.time.zone']}" />
</ice:selectinputdate>
<h:message style="color: red" for="formStartDate" />
</ice:panelgroup>
<ice:panelgrid columns="2" cellpadding="15px">
<ice:commandbutton id="SubmitBtn" type="submit" value="submit" actionListener="#{myBean.searchButtonListener}" />
<ice:commandbutton id="ClearBtn" value="clear" actionListener="#{myBean.clearButtonListener}" immediate="true" />
</ice:panelgrid>
<ice:panelcollapsible id="batchGroupPanel" expanded="true" immediate="true">
<ice:datatable id="myResultTable" var="record" value="#{myBean.searchResults}" rows="#{myBean.searchResults.rowsPerPage}" scrollable="false" columnwidths="110px,100px,300px" cellpadding="0" style="background-color:white" columnclasses="myDatatableElement,myDatatableElementLeft,myDatatableElementLeft" headerclasses="myDatatableElement" width="100%">
</ice:datatable></ice:panelcollapsible>
</ice:form>
</ice:portlet>
</h:body>
</f:view>
Kyle Joseph Stiemann, modifié il y a 7 années.
RE: LazyDataModel.findRows called recursievly from unrelated search field (Réponse)
Liferay Master Publications: 760 Date d'inscription: 14/01/13 Publications récentes
Hi Abey,
Can you try ace:dataTable with IceFaces LazyDataModel instead?
There's an example of how to use ace:dataTable with a LazyDataModel implementation in our old icefaces-users-portlet.
- Kyle
Can you try ace:dataTable with IceFaces LazyDataModel instead?
There's an example of how to use ace:dataTable with a LazyDataModel implementation in our old icefaces-users-portlet.
- Kyle
hoadao hoadao, modifié il y a 6 années.
RE: LazyDataModel.findRows called recursievly from unrelated search field
New Member Envoyer: 1 Date d'inscription: 11/05/17 Publications récentesKyle Joseph Stiemann:
Hi Abey,
Can you try ace:dataTable with IceFaces LazyDataModel instead?
There's an example of how to use ace:dataTable with a LazyDataModel implementation in our old icefaces-users-portlet.
- Kyle
Thank you !!!!