You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Duto <ol...@pasteur.fr> on 2011/04/01 09:16:57 UTC

event when the data update by Data-driven on ListView or TableView

Hello,

Is there a event on ListView or TableView when the data are automatically
update when the model state changes . I search it by I don't found :s

Best regards 

Duto

--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/event-when-the-data-update-by-Data-driven-on-ListView-or-TableView-tp2762353p2762353.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: event when the data update by Data-driven on ListView or TableView

Posted by Noel Grandin <no...@gmail.com>.
No, there is no event like that. You should however, be able to listen to the model itself, because the model fires
events when it changes.

-- Noel

Duto wrote:
> Hello,
>
> Is there a event on ListView or TableView when the data are automatically
> update when the model state changes . I search it by I don't found :s
>
> Best regards 
>
> Duto
>
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/event-when-the-data-update-by-Data-driven-on-ListView-or-TableView-tp2762353p2762353.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: event when the data update by Data-driven on ListView or TableView

Posted by Olivier Dutrieux <ol...@pasteur.fr>.
Le 04/04/2011 15:20, Greg Brown a écrit :
> The event is never fired because you are not calling update() on userList. Try this instead:
>
> public void buttonPressed(Button button) {
>      User user = Constants.users.get(0);
>      user.setEmail("newEmail@gmail.com");
>
>      List<User>  userList = (List<User>)userTableView.getTableData();
>      userList.update(0, user);
> }
>
> You don't need to call repaint() yourself - the TableView will do that automatically when the item is updated.
>
> On Apr 4, 2011, at 8:53 AM, Duto wrote:
>
>> http://apache-pivot-users.399431.n3.nabble.com/file/n2774946/dataDriven.zip
>> dataDriven.zip
>>
>> But I think it's normal that the event is not fire, I modify directly the
>> bean.
>>
>> --
>> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/event-when-the-data-update-by-Data-driven-on-ListView-or-TableView-tp2762353p2774946.html
>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
oki thx G.

Re: event when the data update by Data-driven on ListView or TableView

Posted by Greg Brown <gk...@verizon.net>.
The event is never fired because you are not calling update() on userList. Try this instead:

public void buttonPressed(Button button) {
    User user = Constants.users.get(0);
    user.setEmail("newEmail@gmail.com");
    
    List<User> userList = (List<User>)userTableView.getTableData();
    userList.update(0, user);
}

You don't need to call repaint() yourself - the TableView will do that automatically when the item is updated.

On Apr 4, 2011, at 8:53 AM, Duto wrote:

> http://apache-pivot-users.399431.n3.nabble.com/file/n2774946/dataDriven.zip
> dataDriven.zip 
> 
> But I think it's normal that the event is not fire, I modify directly the
> bean.
> 
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/event-when-the-data-update-by-Data-driven-on-ListView-or-TableView-tp2762353p2774946.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: event when the data update by Data-driven on ListView or TableView

Posted by Duto <ol...@pasteur.fr>.
http://apache-pivot-users.399431.n3.nabble.com/file/n2774946/dataDriven.zip
dataDriven.zip 

But I think it's normal that the event is not fire, I modify directly the
bean.

--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/event-when-the-data-update-by-Data-driven-on-ListView-or-TableView-tp2762353p2774946.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: event when the data update by Data-driven on ListView or TableView

Posted by Greg Brown <gk...@verizon.net>.
I can't open that file. Can you attach it as a zip file or attach the source code to a JIRA ticket?

On Apr 1, 2011, at 7:15 PM, Duto wrote:

> I create a small sample : see attach dataDriven.rar 
> 
> When I clic on button that modify the tableView but the event is never fire. 
> View this message in context: Re: event when the data update by Data-driven on ListView or TableView
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: event when the data update by Data-driven on ListView or TableView

Posted by Duto <ol...@pasteur.fr>.
I create a small sample : see attach 
http://apache-pivot-users.399431.n3.nabble.com/file/n2765417/dataDriven.rar
dataDriven.rar 

When I clic on button that modify the tableView but the event is never fire.



--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/event-when-the-data-update-by-Data-driven-on-ListView-or-TableView-tp2762353p2765417.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: event when the data update by Data-driven on ListView or TableView

Posted by Greg Brown <gk...@verizon.net>.
Any chance you could provide a short code sample that demonstrates the issue?

On Apr 1, 2011, at 5:40 PM, Olivier Dutrieux wrote:

> In fact that doesn't work like I would like : when  I modify directly one bean of my list, the row in Tableview is automaticaly update (by Data-driven components) , but the itemUpdated event is never fire. I try with add listener on List or on TableView
> 
> duto
> 
> Le 01/04/2011 14:34, Duto a écrit :
>> Oki I think it's perfect that I would like : I check it :)
>> 
>> thx
>> 
>> Duto
>> 
>> --
>> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/event-when-the-data-update-by-Data-driven-on-ListView-or-TableView-tp2762353p2763174.html
>> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
> 


Re: event when the data update by Data-driven on ListView or TableView

Posted by Olivier Dutrieux <ol...@pasteur.fr>.
In fact that doesn't work like I would like : when  I modify directly 
one bean of my list, the row in Tableview is automaticaly update (by 
Data-driven components) , but the itemUpdated event is never fire. I try 
with add listener on List or on TableView

duto

Le 01/04/2011 14:34, Duto a écrit :
> Oki I think it's perfect that I would like : I check it :)
>
> thx
>
> Duto
>
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/event-when-the-data-update-by-Data-driven-on-ListView-or-TableView-tp2762353p2763174.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: event when the data update by Data-driven on ListView or TableView

Posted by Duto <ol...@pasteur.fr>.
Oki I think it's perfect that I would like : I check it :) 

thx

Duto

--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/event-when-the-data-update-by-Data-driven-on-ListView-or-TableView-tp2762353p2763174.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

Re: event when the data update by Data-driven on ListView or TableView

Posted by Greg Brown <gk...@verizon.net>.
Do you mean this?

http://svn.apache.org/repos/asf/pivot/trunk/wtk/src/org/apache/pivot/wtk/ListViewItemListener.java
http://svn.apache.org/repos/asf/pivot/trunk/wtk/src/org/apache/pivot/wtk/TableViewRowListener.java


On Apr 1, 2011, at 3:16 AM, Duto wrote:

> Hello,
> 
> Is there a event on ListView or TableView when the data are automatically
> update when the model state changes . I search it by I don't found :s
> 
> Best regards 
> 
> Duto
> 
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/event-when-the-data-update-by-Data-driven-on-ListView-or-TableView-tp2762353p2762353.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.