PDA

View Full Version : [CLOSED] Serialize and Deserialize a complex FormPanel



Arbee
Feb 21, 2014, 12:34 AM
I have tried to use myFormPanel.ToConfig() to serialize a complex FormPanel.

What I would like to do is deserialize that so that a Component Loader can recreate the form later.

ComponentLoader.ToConfig(JSON.Deserialize<FormPanel>(myserializedpanelstring)) fails to deserialize (not got to the loader part yet).

Is there any way to save and restore panel content through binary or string formats?

Daniil
Feb 21, 2014, 3:22 AM
Hi @Arbee,

I would not serialize/deserialize an entire control. I doubt it is going to work.

Please clarify do you need to save/restore a FormPanel's data only or the whole configuration?

Arbee
Feb 21, 2014, 3:27 PM
Hi @Arbee,

I would not serialize/deserialize an entire control. I doubt it is going to work.

Please clarify do you need to save/restore a FormPanel's data only or the whole configuration?

No data just the controls, sub panels etc. We are currently dynamically generating the forms (and they're big) on the fly. We hope to save load time by saving the control definitions and reloading on demand.

Vladimir
Feb 21, 2014, 4:00 PM
Controls don't support serializing/deserializing to JSON.
Do you have any performance problems with control rendering on the server side?

Arbee
Feb 21, 2014, 4:59 PM
Controls don't support serializing/deserializing to JSON.
Do you have any performance problems with control rendering on the server side?

We load about 12 sections (panels) that each have forms and data views with pictures. Only one is visible at a time and we are using a card layout to hold all the sections. We haven't found a way to load the hidden panels in the background so that when we switch they come up quickly. Current load time is down to 6 seconds and we're trying for sub 2 seconds.

We may try to load each section on demand to reduce the DOM and initial load but I thought it worth asking if we could "save" the forms. We have 400 forms, each with 12+ sections & a total of 35K questions.

Any other suggestions would be welcome.

Vladimir
Feb 21, 2014, 6:23 PM
Current load time is down to 6 seconds and we're trying for sub 2 seconds.

What you mean about 'load time'? Possible serialization can reduce server time only and will not help you to improve client side rendering (please note that client side rendering time is much more if compare with server side time because all ui elements are generated on the client side, on the server side we generate script only).



We may try to load each section on demand to reduce the DOM and initial load

I guess that it is best solution.

Also I recommend to try the following approach if you don't want to use loading on demand
http://examples2.ext.net/#/Miscellaneous/Template_Widget/Overview/
http://examples2.ext.net/#/Miscellaneous/Template_Widget/Rendering/
http://examples2.ext.net/#/Miscellaneous/Template_Widget/Cache/

TemplateWidget just renders script but do not execute it until you call its method. So, no dom elements, no performace issues for widgets are not shown initialy

Arbee
Feb 21, 2014, 6:37 PM
Thanks Vladimir, that helps a lot. We can focus on those ideas now.