the problem is a little bit tricky ;)

If you use preserveDataModel="true" the value of your datamodel is not
requested until in the renderphase and will not be used for iteration
and setting rowindex. This is the reason why you don´t get a valid
value for your rowindex and rowdata in process application phase. I
suggest you to change your jsp/bean code into one of the following
way:

- implement your action method into a WfAssignment wrapper class and
use instances of it in your datamodel. Change your jsp code to call
this action method in the wrapped class.

- don´t use preserveDataModel and make sure that your getter method of
the datamodel returns a non null or empty value during the decode
phase.

- provide a setter method for your datamodel. This method is being
called in the update model phase to set the preserved datamodel. The
preserved datamodel will only contain the values for the rendered
page.

2005/10/31, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
> Myfaces..
>
> Thanks again,
> Geeta
>
> Mathias Brökelmann <[EMAIL PROTECTED]> wrote on 10/31/2005
> 04:29:56 AM:
>
>
>  > do you use sun´s ri or myfaces for the core jsf implementation?
>  >
>  > 2005/10/30, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>  > >
>  > > Thanks for your reply Mathias. I attach my bean code here. Please note
> that
>  > > the command links work correctly when within an "ordinary" datatable
> with no
>  > > paging/sorting. It was when i was attempting to see why that I noticed
> the
>  > > pattern of what looks like incorrectly computed rowIndices that i
> mentioned
>  > > earlier..
>  > >
>  > > Thanks again,
>  > > Geeta
>  > >
>  > > Mathias Brökelmann <[EMAIL PROTECTED]> wrote on 10/29/2005
>  > > 03:29:17 AM:
>  > >
>  > >
>  > >  > Could you post your bean code?
>  > >  >
>  > >  > 2005/10/29, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>  > >  > >
>  > >  > > So.. maybe I can ask this question differently..?
>  > >  > >
>  > >  > > Has anybody made command links work within a <t:datatable with
>  > > scrolling and
>  > >  > > sorting also enabled (using tomahawk.jar's tags)? If so would you
>  > > please
>  > >  > > post your code?
>  > >  > >
>  > >  > > Many thanks in advance!
>  > >  > > Geeta
>  > >  > >
>  > >  > > [EMAIL PROTECTED] wrote on 10/28/2005 05:28:13 PM:
>  > >  > >
>  > >  > >
>  > >  > >  >
>  > >  > >  > Hi all:
>  > >  > >  >
>  > >  > >  > I am having trouble getting command links to work correctly
> when I
>  > >  > >  > use tomahawk's <t:dataTable for scrolling and sorting. Briefly,
> the
>  > >  > >  > rowIndex doesn't seem to be correct: I have breakpoints in my
> code
>  > >  > >  > which shows me that while rowCount is correctly computed, for
> some
>  > >  > >  > reason rowIndex seems to be incorrectly computed according to
> the
>  > >  > >  > foll. pattern:
>  > >  > >  >
>  > >  > >  > 1. Page 1 has rows 1 to 5, the rowIndex for all the links in
> this
>  > > page is
>  > >  > > 4.
>  > >  > >  > 2. Page 2 has rows 6 to 10, the rowIndex for all the links in
> this
>  > > page
>  > >  > > is 9.
>  > >  > >  > 3. Page 3 has rows 11 to 15 ,..and yep,.. rowIndex for
> everything
>  > > here is
>  > >  > > 14.
>  > >  > >  >
>  > >  > >  > int rowCount = assignmentsModel.getRowCount();
>  > >  > >  > int rowIndex = assignmentsModel.getRowIndex();
>  > >  > >  >
>  > >  > >  > However if I forget about the scrolling/sorting features
> everything
>  > >  > >  > is calculated properly.
>  > >  > >  >
>  > >  > >  > Details: I downloaded the brand new MyFaces1.1.1 just today.
> Also,
>  > >  > >  > my worklist bean (extends Shale's AbstractViewController) has
>  > >  > >  > request scope, and STATE_SAVING_METHOD is server, returns a
>  > >  > >  > ListDataModel  for its getAssignments() method.
>  > >  > >  >
>  > >  > >  > More details:
>  > >  > >  > My jsp code pretty much follows what is in the "simple"
> examples
>  > >  > >  > pagedSortTable.jsp:
>  > >  > >  >
>  > >  > >  > <h:form id="form1">
>  > >  > >  >         <t:saveState id="worklist" value="#{worklist}" />
>  > >  > >  >         <t:dataTable
>  > >  > >  >                 id="items"
>  > >  > >  >                 styleClass="scrollerTable"
>  > >  > >  >
> headerClass="standardTable_Header"
>  > >  > >  >
> footerClass="standardTable_Header"
>  > >  > >  >
>  > >  > >
> rowClasses="standardTable_Row1,standardTable_Row2"
>  > >  > >  >
>  > > columnClasses="standardTable_Column,
>  > >  > >  >
> standardTable_ColumnCentered,standardTable_Column"
>  > >  > >  >                 var="assignment"
>  > >  > >  >                 value="#{worklist.assignments}"
>  > >  > >  >                 preserveDataModel="true"
>  > >  > >  >                 rows="5"
>  > >  > >  >                 rowId="#{assignment.activityKey}"
>  > >  > >  >                 sortColumn="#{worklist.sort}"
>  > >  > >  >                 sortAscending="#{worklist.ascending}"
>  > >  > >  >                 preserveSort="true"
>  > >  > >  >                 >
>  > >  > >  >
>  > >  > >  >         <h:column>
>  > >  > >  >                         <f:facet name="header">
>  > >  > >  >                                 <t:commandSortHeader
>  > > columnName="name"
>  > >  > > arrow=
>  > >  > >  > "true" immediate="false">
>  > >  > >  >                                         <h:outputText
>  > > value="Assignment"
>  > >  > > />
>  > >  > >  >                                 </t:commandSortHeader>
>  > >  > >  >                         </f:facet>
>  > >  > >  >                         <h:commandLink rendered="#{assignment.
>  > >  > >  > startPhoneAssignment}"
>  > >  > >  >
>  > >  > > action="#{worklist.acceptPhoneAssignment}"
>  > >  > >  > immediate="false">
>  > >  > >  >                                 <h:outputText
>  > >  > > value="#{assignment.activityKey}
>  > >  > >  > " />
>  > >  > >  >                         </h:commandLink>
>  > >  > >  >                 </h:column>
>  > >  > >  >
>  > >  > >  > etc.
>  > >  > >  >
>  > >  > >  > thanks very much for all help!
>  > >  > >  > Geeta
>  > >  >
>  > >  > --
>  > >  > Mathias
>  > >
>  > >
>  > >
>  > >
>  >
>  >
>  > --
>  > Mathias
>  >
>  > --
>  > This message has been scanned for viruses and
>  > dangerous content by MailScanner, and is
>  > believed to be clean.
>  >
>
>
> >
>  > CONFIDENTIALITY NOTICE:This email is intended solely for the person
>  > or entity to which it is addressed and may contain confidential
>  > and/or protected health information.  Any duplication,
>  > dissemination, action taken in reliance upon, or other use of this
>  > information by persons or entities other than the intended recipient
>  > is prohibited and may violate applicable laws.  If this email has
>  > been received in error, please notify the sender and delete the
>  > information from your system.  The views expressed in this email are
>  > those of the sender and may not necessarily represent the views of
>  > IntelliCare.


--
Mathias

Reply via email to