2010/8/3 Dietrich Streifert <[email protected]>
>
> No. I'm not using qx.form.Form at all. Coming from ancient qooxdoo times I
> developed my own xml centric form handling. Fields are "tagged" with their
> xml xpath (via mixin). The fields are kept fast accessible via their xpath
> by a hash (something like form.getMapper().getFieldValue('/foo/bar') is very
> fast). My form handler called, xml mapper, is xml "aware". The form method
> setXML which has xml doc object as parameter fills the form with the values
> of the xml doc elements or attributes. More then that there is load and save
> which does the complete communication with the backend.
>
That actually sounds like a pretty nice setup.
> The patient chart is loaded as a single xml-request. So, even if not
>> visible, values are loaded into fields and cause changevalue events which
>> have an influence to other fields like disabled fields etc.
>>
>
> But that part shouldn't take very long.
> The actual rendering of all the widgets is another case.
>
>
> As said before: I suspected the raise in dom creation being the the
> performance impact. I'm not sure.
>
I can't say what the reason behind the peformance _change_ is, but I do know
that about 80% of the time is spent drawing DOM nodes.
Not executing your javascript code.
>
> Playground code to prove my case:
> http://tinyurl.com/2fnf7a2
>
> >So, even if not visible, values are loaded into fields and cause
> changevalue events which have an influence to other fields like disabled
> fields etc.
>
> Feel free to create the fields! Just don't *render* them.
> *Don't add them all to the DOM at once!*
>
> In your screenshots I see widgets inside tab-pages.
> The only way those widgets can be in a tab-page is if you *add* them.
> So, somewhere in your code, there has to be something like:
>
> myTabPage.add ( myWidget );
>
> All i'm saying is that if you replace that code with:
>
> myTabPage.addListenerOnce('appear', function(
> myTabPage.add( myWidget );
> });
>
>
> So let's say I have a tab page which is currently not visible. The form is
> opened via the user. After the form is shown the load via xhr is started and
> on success my xml mapper starts filling the field values via their xpath. At
> this point the fields of the yet hidden tab page are not instantiated. The
> initialization fails. OK there is the possibility to also do a lazy init of
> the field values after field instantiation of the hidden page. So I would do
> a addListenerOnce('appear',...) to every field instance which does the init
> from the current loaded xml doc. Maybe that would be a way.
>
Ehm, why would they not be instantiated?
x = new qx.ui.form.TextField;
x.setValue('test');
x.setEnabled( false );
I don't have to add that textfield to a visisble container EVER, and it
would still be fully functional.
It would fire events and everything. *It's just not rendered, until I add it
somewhere.*
You seem to assume that " new qx.ui.form.TextField " creates the dom nodes.
It does not.
*http://tinyurl.com/28bbqpn*
**Notice that I assign values to the textfield and attach an eventhandler.
(that is already firing!)
Sure, in your code it's problely called something other than "myTabPage".
> And your code is likely way more complicated than this. But somewhere,
> somehow you are adding widgets to a tabpage.
> And right there, you replace that code with the 'appear' trick above.
>
>
> OK I'll have a look into your trick as soon as possible.
>
The thing is, you can have your whole and all the fields interact. All the
qooxdoo form fields created and instantiated.
Just don't 'render' them yet.
The render phase happens (delayed actually, using a timer on a queue), when
you add these fields to an already rendered widget.
And if you fix your problem like this, you'll go to 0.5 sec load time on IE.
Sure it will be 0.5 sec every time somebody clicks a tab that hasn't been
viewed yet.
So the 9 seconds are 'spread out'. But it will feel much more responsive
this way.
*I'll make you a bet*
> If this trick doesn't cut the load time by 80%, I'll drink a German beer
> this week ;-)
>
>
> Don't hesitate! Drink German beer! But you have to choose the right
> brand;-)
>
> Ralf, I really appreciate your comments and they are very welcome. So take
> in account that I'm from Germany and maybe my writing seems little bit crude
> compared to native English writers. So I want to apologize for that. I'm a
> nice guy;-)
>
Ah, yes. Well, I was just trying not to be too dutch and in-your-face. But
it's hard for me.
It's not my native language either :-)
Greetings,
Ralf
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel