You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by gr...@intellicare.com on 2005/10/28 23:28:13 UTC

Incorrect rowindex for datatable with tomahawk's sorting and scrolling features.

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

Re: Incorrect rowindex for datatable with tomahawk's sorting and scrolling features.

Posted by Mathias Brökelmann <mb...@googlemail.com>.
the uidata implementation currently don´t seam to reset the rowindex
to -1 after rendering. Your state is saved in serverstate and you use
t:savestate to store the state of worklist which means you will get
for every new request on that page the same instance of your worklist
bean (Note: this behavior is changed in the current trunk/nightly and
your bean must be serializable). The datamodel still contains the last
set rowindex which wasn´t reset by the renderer.

2005/10/31, gramani@intellicare.com <gr...@intellicare.com>:
>
> Mathias Brökelmann <mb...@googlemail.com> wrote on 10/31/2005
> 08:35:43 AM:
>
>  > 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.
>  >
>
> Thanks very much for your response. I shall try each of your ideas in turn.
> But I do have another question. You say using preserveDataModel="true" means
> that the value of the datamodel is not requested till the render phase. Does
> this explain why the rowIndex *always* is one less than the index of the
> largest index of the item currently shown? (I mean all pages have 5 items
> shown, and page1 has rowindex of all items as 4, page 2 has rowindex of all
> items as 9, page 3 has rowindex of all items as 14.. I can accept I think
> that rowindex can have wrong values but seems wierd that the the wrong
> values are following a pattern, and worse, always returning a constant (per
> page). Of course I am quite new with all this so I am probably missing
> something quite basic..
>
> Thank you for your continued interest and time - I really appreciate it!
> Geeta
>


--
Mathias

Re: Incorrect rowindex for datatable with tomahawk's sorting and scrolling features.

Posted by gr...@intellicare.com.
Mathias Brökelmann <mb...@googlemail.com> wrote on 10/31/2005 
08:35:43 AM:

> 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.
> 

Thanks very much for your response. I shall try each of your ideas in 
turn. But I do have another question. You say using 
preserveDataModel="true" means that the value of the datamodel is not 
requested till the render phase. Does this explain why the rowIndex 
*always* is one less than the index of the largest index of the item 
currently shown? (I mean all pages have 5 items shown, and page1 has 
rowindex of all items as 4, page 2 has rowindex of all items as 9, page 3 
has rowindex of all items as 14.. I can accept I think that rowindex can 
have wrong values but seems wierd that the the wrong values are following 
a pattern, and worse, always returning a constant (per page). Of course I 
am quite new with all this so I am probably missing something quite 
basic..

Thank you for your continued interest and time - I really appreciate it!
Geeta

Re: Incorrect rowindex for datatable with tomahawk's sorting and scrolling features.

Posted by gr...@intellicare.com.
Mathias Brökelmann <mb...@googlemail.com> wrote on 10/31/2005 
08:35:43 AM:

> 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.

For the sake of completeness of this thread, I want to let you know a 
combination of your suggestions worked Mathias.:) I didn't use 
preserveDatModel and also provided a setter for my datamodel - and now the 
rowIndex is calculated correctly and things work great!

Thank you again for yout time!
Geeta


Re: Incorrect rowindex for datatable with tomahawk's sorting and scrolling features.

Posted by Mathias Brökelmann <mb...@googlemail.com>.
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, gramani@intellicare.com <gr...@intellicare.com>:
>
> Myfaces..
>
> Thanks again,
> Geeta
>
> Mathias Brökelmann <mb...@googlemail.com> 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, gramani@intellicare.com <gr...@intellicare.com>:
>  > >
>  > > 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 <mb...@googlemail.com> wrote on 10/29/2005
>  > > 03:29:17 AM:
>  > >
>  > >
>  > >  > Could you post your bean code?
>  > >  >
>  > >  > 2005/10/29, gramani@intellicare.com <gr...@intellicare.com>:
>  > >  > >
>  > >  > > 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
>  > >  > >
>  > >  > > gramani@intellicare.com 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

Re: Incorrect rowindex for datatable with tomahawk's sorting and scrolling features.

Posted by gr...@intellicare.com.
Myfaces..

Thanks again,
Geeta

Mathias Brökelmann <mb...@googlemail.com> 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, gramani@intellicare.com <gr...@intellicare.com>:
> >
> > 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 <mb...@googlemail.com> wrote on 10/29/2005
> > 03:29:17 AM:
> >
> >
> >  > Could you post your bean code?
> >  >
> >  > 2005/10/29, gramani@intellicare.com <gr...@intellicare.com>:
> >  > >
> >  > > 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
> >  > >
> >  > > gramani@intellicare.com 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.

Re: Incorrect rowindex for datatable with tomahawk's sorting and scrolling features.

Posted by Mathias Brökelmann <mb...@googlemail.com>.
do you use sun´s ri or myfaces for the core jsf implementation?

2005/10/30, gramani@intellicare.com <gr...@intellicare.com>:
>
> 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 <mb...@googlemail.com> wrote on 10/29/2005
> 03:29:17 AM:
>
>
>  > Could you post your bean code?
>  >
>  > 2005/10/29, gramani@intellicare.com <gr...@intellicare.com>:
>  > >
>  > > 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
>  > >
>  > > gramani@intellicare.com 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

Re: Incorrect rowindex for datatable with tomahawk's sorting and scrolling features.

Posted by gr...@intellicare.com.
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 <mb...@googlemail.com> wrote on 10/29/2005 
03:29:17 AM:

> Could you post your bean code?
> 
> 2005/10/29, gramani@intellicare.com <gr...@intellicare.com>:
> >
> > 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
> >
> > gramani@intellicare.com 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


 

Re: Incorrect rowindex for datatable with tomahawk's sorting and scrolling features.

Posted by Mathias Brökelmann <mb...@googlemail.com>.
Could you post your bean code?

2005/10/29, gramani@intellicare.com <gr...@intellicare.com>:
>
> 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
>
> gramani@intellicare.com 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
>  >
>  > --
>  > 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

Re: Incorrect rowindex for datatable with tomahawk's sorting and scrolling features.

Posted by gr...@intellicare.com.
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

gramani@intellicare.com 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 
> 
> -- 
> 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.