Dynamically editing list of ValueProxies with ListEditor

95 views
Skip to first unread message

Mihail Lesikov

unread,
Aug 15, 2011, 8:49:09 AM8/15/11
to google-we...@googlegroups.com
I have a list of phoneNumbers(ValueProxy) for a specified contact that I need to edit dynamically(add new/remove/change) using ListEditor.

When I try to remove one of the phoneNumbers :

listEditor.getList().remove(phoneNumber); // phone number is the last proxy in the list

1) as a result, the first element in the list is always removed
2) when flush is called on the contactEditor(parent editor that contacs the driver), no values are filled in the list of phoneNumbersProxies

Other thing that i noticed is that every valueProxy.hashCode() is the same as others from that type.

Miroslav Genov

unread,
Aug 15, 2011, 10:57:27 AM8/15/11
to google-we...@googlegroups.com
What version of GWT  you are using  ?

What happens if you try something like:

PhoneNumber p1 = request.create(PhoneNumber.class);
PhoneNumber p2 = request.create(PhoneNumber.class);

p1.setValue("234234234");
p2.setValue("123123333");

p1.equals(p2) 

?

Mihail Lesikov

unread,
Aug 17, 2011, 3:01:45 AM8/17/11
to google-we...@googlegroups.com
What version of GWT  you are using  ?

GWT 2.4 rc1
 

What happens if you try something like:

PhoneNumber p1 = request.create(PhoneNumber.class);
PhoneNumber p2 = request.create(PhoneNumber.class);

p1.setValue("234234234");
p2.setValue("123123333");

p1.equals(p2) 

p1.equals(p2)  
the result is false


 

Mihail Lesikov

unread,
Aug 17, 2011, 3:07:32 AM8/17/11
to google-we...@googlegroups.com
listEditor.getList().remove(phoneNumber); // phone number is the last proxy in the list

1) as a result, the first element in the list is always removed 
2) when flush is called on the contactEditor(parent editor that contacs the driver), no values are filled in the list of phoneNumbersProxies
 
 The problem here is related with issue http://code.google.com/p/google-web-toolkit/issues/detail?id=6081 - bug with the RequestFactoryEditorDriver,
 With the SimpleBeanEditorDriver instead of RequestFactoryEditorDriver everything works fine.
 

Other thing that i noticed is that every valueProxy.hashCode() is the same as others from that type.

Newly created proxies without any changes on their properties:
PhoneNumber p1 = request.create(PhoneNumber.class);
PhoneNumber p2 = request.create(PhoneNumber.class);

p1.equals(p2) is true (same hashCode) 
don't know why?


Reply all
Reply to author
Forward
0 new messages