-1

I have an application which must save client instances of com.smartgwt.client.widgets.Canvas to a disk on the server, and then restore them.

My solution is to serialize the canvases, send them to the server to be saved, save them, load them, send them back to the client, and then deserialize.

Currently, the network transfer code is all in place. The only thing left is serializing the canvases. However, I want to know if doing so is even possible? If not, any workarounds? Clues?

Thanks, Ian

geometrian
  • 14,775
  • 10
  • 56
  • 132

1 Answers1

0

I would suggest that you do not serialize the Canvases themselves, but instead save their state. Depending on what the canvases contain, this can be easier or harder, but in most cases makes better sense than trying to save the objects themselves. SmartGWT provides API calls to save the state of some complex object, e.g. ListGrids . For simpler objects you can come up with a way to store their view state, e.g by using a JSON object that holds of what is important to your case.

gpapaz
  • 889
  • 14
  • 23
  • I initially did not want to do this, but after some more research, it appears that this is the *only* way to do it. Thanks, – geometrian Apr 21 '12 at 05:24