Looking at the code, the table always sets the first page whenever a
DataProvider is given. (New data means that the table state must be
reset and users start off on page one.) I can see that once the
setFirst() method has been invoked, and a local variable is set, the
value expression is never used. The value expression usage is typical
JSF behavior, but we might be able to tweak the code a bit.
That said, if you're trying to restore table state (e.g., returning to a
previous page), use the save/restoreState methods of the component via a
binding. There is more state that should be considered such as sorting,
filtering, etc.
Dan
John Yeary wrote:
> Hello Dan, et.al <http://et.al>.,
>
> Have you confirmed that the value expression is not working properly?
> If so, I will open an issue.
>
> John
>
> On 6/25/07, * John Yeary* <johnyeary_at_gmail.com
> <mailto:johnyeary_at_gmail.com>> wrote:
>
> Hello Dan,
>
> I was expecting it to display the 9th row starting with 0. It is
> the value expression which puzzles me.
>
> Thanks for taking a look.
>
> John
>
>
> On 6/25/07, * Dan Labrecque - Sun Microsystems*
> <Dan.Labrecque_at_sun.com <mailto:Dan.Labrecque_at_sun.com>> wrote:
>
> There is nothing special about the first property except that rows
> always start at index zero. That's probably why your seeing
> the ninth
> row displayed. I cannot say why your code behaves differently
> for a
> value expression, but I'll try to test this myself.
>
> Dan
>
> John Yeary wrote:
> > Hello All,
> >
> > I originally posted this to the dev list by mistake. This is
> the more
> > appropriate list.
> >
> > I am trying to determine if the behavior I am seeing is
> abnormal. If I
> > set the tag to a value such as 8 as noted below. This results
> in the
> > table displaying rows starting at 9. This is okay.
> >
> > <webuijsf:tableRowGroup first="8" binding="#{
> Page1.tableRowGroup1 }"
> > id="tableRowGroup1" rows="3"
> sourceData="#{Page1.tripDataProvider}"
> > sourceVar="currentRow">
> >
> > The quirk is if I use a binding to set the value, it does not
> > correctly set it to the appropriate value. See below.
> >
> > This is in the SessionBean:
> >
> > private int selectedValue = 8;
> >
> > public int getSelectedValue() {
> > return selectedValue;
> > }
> >
> > This is the new binding on the JSP:
> >
> > <webuijsf:tableRowGroup first="#{SessionBean1.selectedValue}"
> > binding="#{Page1.tableRowGroup1}" id="tableRowGroup1" rows="3"
> >
> sourceData="#{Page1.tripDataProvider}"
> > sourceVar="currentRow">
> >
> > I would have expected it to start on row 9. Am I missing
> something, or
> > is this a bug?
> >
> > I added a button to the table which sets the first value to the
> > selectedValue and it works as expected.
> >
> > public String button1_action() {
> > tableRowGroup1.setFirst
> (getSessionBean1().getSelectedValue() -
> > 1);
> > return null;
> > }
> >
> > This is behavior I want, but I would expect that if I use a
> binding it
> > should work too. I should not have to put a button on the
> page and
> > force the user to press it to go to the selectedValue.
> >
> >
> > John
> >
> > --
> > John Yeary
> > --
> > "If I have seen further, it is because I have stood on the
> shoulders
> > of giants..." Sir Isaac Newton
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe_at_woodstock.dev.java.net
> <mailto:users-unsubscribe_at_woodstock.dev.java.net>
> For additional commands, e-mail:
> users-help_at_woodstock.dev.java.net
> <mailto:users-help_at_woodstock.dev.java.net>
>
>
>
>
> --
> John Yeary
> --
> "If I have seen further, it is because I have stood on the
> shoulders of giants..." Sir Isaac Newton
>
>
>
>
> --
> John Yeary
> --
> "If I have seen further, it is because I have stood on the shoulders
> of giants..." Sir Isaac Newton