문제

UPDATE II: OK, I managed to narrow it down a little.

I have a page with a datatable with sorting and filtering functionalities, both taking place in the DB. In other words, I do not use the embedded functionality of the rich:datatable I use, but rather let the DB do the work.

I work with request-scoped beans. The only session-scoped beans contain the sorting and filtering of my interface.

Filtering for each column is bound to the certain session bean fields. As such, it is actually updated during the Update Model Values phase.

Sorting required some logic from my part, so I invoke a certain method to set the correct values to the session bean. This is performed during the Invoke Application phase.

So, any changes are in place during the Render Response phase, where the page actually renders.

The problem is that the JSF datatable and datascroller in my page call the backingBean.getDataModel() that fetch the data from the DB and the dataModel.getRowCount() (which I have implemented to invoke a method that runs a separate query) also during the Apply Request Values phase. These two queries take also place during the Render Response Phase, which is the only phase where the changes are all in place, and the query will run normally.

This means that to show a page after I perform filtering or sorting, the double number of queries take place.

I want to perform sorting and filtering only performing the required queries and no more.

Any suggestions?

도움이 되었습니까?

해결책

jQuery로 그것을 할 수 있어야합니다.시뮬링 $

(document).ready(function(){
 GetDisplayFieldByTitle= function (title) {
        var stringToFind = '<!-- FieldName="' + title + '"';
        var formFields = $('td.ms-formbody');
        var foundItem;
        $(formFields).each(function (item) {
            if (formFields[item].innerHTML.indexOf(stringToFind) > -1) {
                foundItem = $(formFields[item]);

            }
        });
        if (!foundItem)
            alert("An td with a class of ms-formbody containg the text " + stringToFind + " was not found");
        return foundItem;
    };
GetDisplayFieldByTitle('Body').attr("width","100%")

});
.

2010 년에는 해당 기능을 사용하지만 2013 년에는 작동해야합니다.

또는 2013 년에 클라이언트 측 렌더링을 살펴볼 수 있거나 사용자 정의 렌더링 템플릿이지만 더 많은 작업이 될 것입니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top