I am working on Orbeon forms and i have a performance related issue as explained below.
I have a form where I have five fields initially. On the fifth dropdown field, if I select “Yes”, because of xforms:group it shows a block of fields (the block has around 40 fields).
Since the block is in the repeated section, I can add/delete as many blocks as I can.
Now, if I add say 10 blocks and when I toggle the fifth dropdown field from any value to “Yes”, it takes more than 2 seconds to display all the blocks.
I am using Orbeon Forms 3.8 and Tomcat 6 on Windows XP desktop with 2GB RAM.
Please let me know what happens when “Yes” is selected (meaning conditional display when xforms:group is true) which is taking more time to display.
<xforms:group ref=".[instance('form-attributes')/flag='yes']" >
//code for the controls here
</xforms:group>
If you are using code that looks like:
conditionis false, the fields inside the group are non-relevant. The XForms engine doesn’t compute their value, read-only status, validity, label, hint, help, alert, etc.conditionbecomes true, the content of the group become relevant, and the XForms engine evaluates all the controls inside the group.Typically, step #2 is much faster than #3, especially with IE7. To avoid the numerous updates on step #3, another way to write this code is:
With this, the fields inside the
divwill always be relevant:conditionbecomes true, all the browser might need to do is to flip that class on thediv. It won’t necessarily need to update all the controls inside, unless of course their value has also changed.conditionis false, the XForms engine, on the server, needs to keep all the controls inside thedivup-to-date.But more often than not, especially when you’re seeing IE7 slowness, the performance you gain on the client far outweighs the increased processing that might be needed on the server.