Hi, I've read some past emails on this subject, but I want to know if
anyone has a best practice for this.

Lets say I have MyService(HashMap<String,Serializable> reportBag) .
I've read it's advisable to narrow down the "Serializable" to a type
that has a smaller set of implementations, such as using GXT2's
serializable BeanModel or making up a marker like SerializaleDTO (or
for that matter, the old IsSerializable)  I'd be willing to do this,
except I'd like to put ArrayList<BeanModel> in my
HashMap<String,Serializable> reportBag

When I start stuffing things in my bag from widgets like selections
from grids, etc, these my come back as ArrayList<BeanModel>.

This means if I want to do

reportBag.put("StuffFromWidget1",myGrid.getSelection());
it won't work unless myGrid.getSelection() is null.

I tried wrapping ArrayList<BeanModel> in a new implementation of
BeanModel, but it still did not work (same error, even after
cleaning).

I guess what I'm looking for is a way to sent an object with an
arbitrary number and combination of beans and lists of beans, where a
bean is a Serializable object.  I'd prefer to use some sort of map, so
I can look up the objects in my service impl.

i.e.
reportBag = new HashMap<String, Serializable>();
reportBag.put("SomeText","JustText");
reportBag.put("SomeBean",imaSerializableBean);
reportBag.put("ListOBeans",thatListOBeansFromAWidget);
reportBag.put("OneMoreBean",forGoodMeasureBean);
etc etc

then

MyServiceAsync.RPC.runReport(reportBag, callback);

Is this possible?


I know topics on serialization get hashed and rehashed here and I sure
don't want to bother people with noob questions.  I must have read 40
threads on it today!  Now I'm off to google code search to try and
find something in the wild...

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to