> -----Original Message-----
> From: Werner Punz [mailto:[EMAIL PROTECTED]
> Subject: Re: Datatable Problem/Bug second attempt
> Mhh no answer, guess I am alone with my problem...
> Does anybody use the data table at all in combination with a
> search area on the same page?
> If yes... can any hints towards a best practice pattern, for
> this case?
Yeah, you are definitely doing something wrong. The problem in your case
is that you are using two different beans with different scopes. The
properties of the longer-than-request scoped bean are populated before
the action in your request scoped bean is executed, but you are likely
using the session scoped bean as a managed property of the request
scoped bean, and those instances are set when your request scoped bean
is created. The whole thing causes it to look like the propery updates
are coming in "late". One way to fix it is to move your search action to
the same bean as where your search properties are, which is a better
design anyway.
We have a similar page, but our search backing bean is request scoped,
and only the results are stored in the session scope with x:saveState.
Kalle
> Werner Punz wrote:
>
> > Since I got no concrete answer on my problem I'll make a second
> > attempt with more info I found out in the meanwhile.
> >
> > There seems to be a problem with the rendering order between a
> > DataTable and the rest of the components.
> >
> > Here is my situation:
> > I have a form which encloses several
> > components which are needed for the search and a datatable
> component
> > with a custom data model.
> > There is a command link which should trigger the query via a custom
> > method in the backing bean something like this
> >
> > The scope of the bean connected to the input fields is longer than
> > request (if you look into the attached fields it might look
> weird, but
> > I have handled them by a transparent query history cache which has
> > session scope and a limited size)
> >
> > <h:inputText id="search1" size="40"
> > value="#{mybeanwithasessionscoe.property}" />
> >
> > <h:commandLink id="search" action="#{backingBean.startSearch}">
> > <h:outputText value="[Search]"/>
> > </h:commandLink>
> >
> > The table which is below the search area within the same form is a
> > standard datatable with a custom datamodel and a connected data
> > scroller... (see the attached files)
> >
> > The problem I run into is, that the search is triggered, but at the
> > moment the search method is called the first time the
> values are not
> > set in the bean which is connected to the input fields.
> > Then the table is rendered, thus it uses the old values, then the
> > method of the commandLink is called a second time, but this
> time the
> > values are transferred into the bean which keeps the search values.
> >
> > The problem with this is, that the table is rendered way before the
> > values are transferred into the bean which is also used by
> the table
> > model to filter the datasets. Thus the rendering of the table is
> > usually one click behind the input of the fields.
> > Is this a bug, or do I miss something here?
> >
> > immediate true or false in the command link unfortunately does not
> > make any difference, and my search field history works as
> expected, i
> > was able to check that in the debugger via the object ids, it was
> > giving back.
> >
> >
> >-------------------------------------------------------------
> ----------
> >-
> >
> ><%@ page session="false" contentType="text/html;charset=utf-8"%>
> ><%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> <%@ taglib
> >uri="http://java.sun.com/jsf/core" prefix="f"%> <%@ taglib
> >uri="http://myfaces.sourceforge.net/tld/myfaces_ext_0_9.tld"
> >prefix="x"%>
> >
> > <h:panelGroup id="mymaster" >
> >
> > <x:dataTable id="zdata2"
> value="#{testBean.dataModel}" var="bean"
> > preserveDataModel="false"
> > styleClass="scrollerTable"
> >
> > headerClass="standardTable_Header"
> > footerClass="standardTable_Header"
> >
> rowClasses="standardTable_Row1,standardTable_Row2"
> >
> columnClasses="standardTable_Column,standardTable_ColumnCenter
> ed,standardTable_Column,standardTable_Column,standardTable_Column"
> > rows="10" >
> >
> > <h:column>
> > <f:facet name="header">
> > <h:panelGroup>
> >
> <h:commandLink actionListener="#{testBean.sort}"
> >
> immediate="false">
> >
> <f:param name="sortValue" value="id" />
> >
> <h:outputText value="ID" />
> > </h:commandLink>
> > </h:panelGroup>
> > </f:facet>
> >
> > <h:outputText
> value="#{bean.id}" />
> > </h:column>
> >
> > <h:column>
> > <f:facet name="header">
> > <h:commandLink
> actionListener="#{testBean.sort}" immediate="false">
> >
> <f:param name="sortValue" value="vname" />
> >
> <h:outputText value="VORNAME" />
> > </h:commandLink>
> > </f:facet>
> > <h:outputText
> value="#{bean.vname}" />
> > </h:column>
> >
> > <h:column>
> > <f:facet name="header">
> > <h:panelGroup>
> >
> <h:commandLink actionListener="#{testBean.sort}" immediate="false">
> >
> <f:param name="sortValue" value="nname" />
> >
> <h:outputText value="NACHNAME" />
> > </h:commandLink>
> > </h:panelGroup>
> > </f:facet>
> > <h:outputText
> value="#{bean.nname}" />
> > </h:column>
> >
> >
> > <jsp:include page="stdcolumnop.jsp" />
> >
> > </x:dataTable>
> >
> > <jsp:include page="datascroller.jsp" />
> >
> > </h:panelGroup>
> >
> >-------------------------------------------------------------
> ----------
> >-
> >
> ><%@ page
> > import="java.math.BigDecimal,
> > java.util.Date, forms.TestClassDetail "%> <%@ page
> >session="false" contentType="text/html;charset=utf-8"%>
> ><%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
> <%@ taglib
> >uri="http://java.sun.com/jsf/core" prefix="f"%> <%@ taglib
> >uri="http://myfaces.apache.org/extensions" prefix="x"%> <%@ taglib
> >uri="http://java.sun.com/jstl/core" prefix="c" %>
> >
> ><html>
> >
> >
> ><body>
> ><f:view>
> > <h:panelGroup id="body">
> >
> > <h:messages id="messageList" showSummary="true"
> showDetail="false" />
> >
> > <h:inputHidden id="hidden"
> value="#{testBean.pagePos}" />
> > <h:form id="mainForm">
> > <f:subview id="createForm">
> > <h:panelGrid columns="2"
> id="queryFields">
> > <h:outputLabel
> for="searchvname" value="Vorname" />
> > <h:inputText
> id="searchvname" size="40" value="#{testBean.query.delegate.vname}" >
> >
> <f:validateLength minimum="3" maximum="20" />
> > </h:inputText>
> > <h:outputLabel
> for="searchnname" value="Nachname" />
> > <h:inputText
> id="searchnname" size="40"
> >value="#{testBean.query.delegate.nname}" />
> >
> > <h:commandLink
> id="search" action="#{testBean.query.startQuery}" rendered="true" >
> >
> <h:outputText value="[Suchen]" />
> > </h:commandLink>
> > <h:commandLink
> id="searchclar" action="#{testBean.query.resetQuery}"
> rendered="true">
> >
> <h:outputText value="[Zuruecksetzen]" />
> > </h:commandLink>
> >
> > </h:panelGrid>
> > </f:subview>
> >
> > <h:inputHidden id="pagePos"
> value="#{testBean.pagePos}" />
> > <f:subview id="masterTable">
> > <jsp:include
> page="inc/testingMasterTableModel.jsp" />
> > </f:subview>
> >
> >
> > <f:verbatim>
> > <br>
> > </f:verbatim>
> > <h:panelGroup id="setOperations">
> > <h:commandLink id="createEntry"
> action="gocreate"
> > rendered="true">
> > <h:outputText
> value="[Neuen Eintrag anlegen]" />
> > </h:commandLink>
> > <h:commandLink
> id="deleteAllData" action="godeleteall"
> > rendered="true">
> > <h:outputText
> value="[Ausgewaehlte Datensaetze loeschen]" />
> > </h:commandLink>
> >
> > </h:panelGroup>
> > </h:form>
> > </h:panelGroup>
> >
> ></f:view>
> >
> ></body>
> >
> ></html>
> >
> >
>
>