gino1234 / wogwt

Automatically exported from code.google.com/p/wogwt
0 stars 0 forks source link

null exception when creating eo in client side #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,
In WOGWTDemo, I have try to create a new MovieClient on client side, But an 
exception is raised as the globalID is null when it is sent to server. There is 
no way to set a temp value as we cannot use setGlobalID().
Is there a solution ?
Thanks in advance

Original issue reported on code.google.com by pierregi...@gmail.com on 8 Jun 2012 at 12:17

GoogleCodeExporter commented 8 years ago
There are a few options:

1) You could request an empty instance on the server first, then send that to 
the client, modify it and send it back.
2) You could send a Map with the values to the server and create the real 
object on the server.
3) You could modify WOGWT to make this work.  I don't think there are any 
problems doing it.

However, if you just getting started I would recommend using the RequestFactory 
that was introduced in 2.1 (I think).  That basically gives you a built-in way 
to work with an object graph like EOF has.  It is much nicer than this I think, 
although I haven't used it yet.

Original comment by johnth...@gmail.com on 11 Jun 2012 at 4:50

GoogleCodeExporter commented 8 years ago
Thanks for this ideas.

RequestFactory seems promissing but it's out of my knowlwdge as I am mainly a 
Java swing dev. 
On Java swing client, you can manipulate EO as if they were on server. I am 
looking to something similar with gwt and your framework.
I am looking to something easy to implement, So I was thinking to add a status 
field on EOClient with value like {"Insert",Update","Delete"}.
When client ask an array of OE, Its get, with relations, n tree of EOclient. 
After modification when user save, the whole new tree is send back. On the 
server serviceImp, the whole tree is read and the modification are done on 
EOServer accordingly.
The server OE can be obtain from EOGlobalId with 
ERXEOControlUtilities.convertGIDtoEO(editingContext(), MyEOClient.__globalID()).

What do you thing of this approach ?

Thanks
Pierre
NB : Sorry for verbosity, errors but you have surely noticed that english is 
not my mother tongue ;-)

Original comment by pierregi...@gmail.com on 12 Jun 2012 at 6:16

GoogleCodeExporter commented 8 years ago
>In WOGWTDemo, I have try to create a new MovieClient on client side, But an 
exception >is raised as the globalID is null when it is sent to server. There 
is no way to set a >temp value as we cannot use setGlobalID().
>Is there a solution ?
An easy way without modifying wogwt is to make sure that toString() is 
overrided.

Original comment by pierregi...@gmail.com on 29 Apr 2013 at 2:47