Ok Michael!
Thanks for having post your bug to Tomahawk's JIRA and thanks for this patch suggest. I was going mad... not seeing what was wrong with my page.
The patch acts at HtmlDataScroller level and, so, only applies to UIData"first" attribute.
What about other attributes in UIData (e.g rows and rowIndex)? The problem stills the same.
Suppose that you bind a dataTable rows attribute to a backing bean. If you then have a programatic component modifying the value, you hope the new value to be applied to your backing bean and not... to UIData inner rows attribute! Am I wrong?
Is there any prohibition in JSF 1 specs for updating valueBinding underlying attribute? Martin's fix exposed in Tomahawk's JIRA seems to take this for a matter of fact
http://issues.apache.org/jira/browse/TOMAHAWK-764#action_12446343 .
Why UIData does this :
/**
* Set the maximum number of rows displayed in the table.
*/
public void setRows(int rows)
{
_rows = new Integer(rows);
if (rows < 0)
throw new IllegalArgumentException("rows: " + rows);
}
Thanks for any explanation!!
Harry!
2006/11/7, Michael Heinen <[EMAIL PROTECTED]>:
See this patch for the datascroller (for 1.1.5)
http://issues.apache.org/jira/browse/TOMAHAWK-764?page=all
-----Original Message-----
From: Jeff Bischoff [mailto:[EMAIL PROTECTED]]
Sent: Montag, 6. November 2006 18:48
To: MyFaces Discussion
Subject: Re: Uidata first argument valueBinding MyFaces 1.1.3
Harry,
I have made a wiki page [1] on this subject. Under the current
implementation, you have to supply the glue for this yourself. ( i.e. the
attribute "first" can be considered read-only)
Dev team - this question gets asked a lot. Maybe it is time to change
the behaviour of t:dataTable/t:dataScroller to be more intuitive?
[1] http://wiki.apache.org/myfaces/ManagingDataScrollerPage
Regards,
Jeff Bischoff
Kenneth L Kurz & Associates, Inc.
Harry Co wrote:
> Hi all,
>
> I wondering about something sounding odd.
> It appears that binding a variable to argument "First" in UIData (ex:
> HtmlDataTable) does not cause the binding method to be called when
value
> changes.
> *More explicitly:*
> I have a dataTable like this (I've removed other not releavant
arguments):
> *<t:dataTable first="#{myDataListBean.myBeanListStart}">*
> *MyDataBean* is a managed bean scoped "session" and holds an
integer
> attribute called "myBeanListStart".
> When I try to change the value of "myBeanListStart" by some
dataScrolling
> (<t:dataScroll>), HtmlDataScroller.broadcast(...) is called and calls
in
> turn getUIData().setFirst(...).
> But surprise, the implementation of UIData modifies its own "first"
> argument
> and not MyDataListBean.myBeanListStart even if a proper
setMyBeanListStart
> exists on MyDataListBean.
> Here's the code of UIData (myFacaes 1.1.3):
>
>
>>
>> public void setFirst(int first)
>> {
>> if (first < 0) {
>> throw new IllegalArgumentException("Illegal value for
first
>> row: " + first);
>> }
>> _first = new Integer(first);
>> }
>>
>> public int getFirst()
>> {
>> if (_first != null)
>> return _first.intValue();
>> ValueBinding vb = getValueBinding("first");
>> Number v = vb != null ? (Number)
vb.getValue(getFacesContext()) :
>> null;
>> return v != null ? v.intValue() : DEFAULT_FIRST;
>> }
>>
> Does someone knows why UIData acts like that? Is there anyway to get
> myBeanListStart modified this way?
>
> TIA.
>
> Harry.
>

