Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

How to refresh contents of a drop down list without using remerge.

Avatar

Level 1

Hi,

I have inherited a large complex dynamic form with multiple drop down lists populated from WSDL requests when the docReady event is triggered.  It presently takes over 20 seconds to load the form, during which time either nothing or a blank form is displayed.  I have been tasked with improving the loading time and I have discovered that the WSDL part of the start up is very quick.

I have found the culprit: xfa.host.remerge();  It takes over 12 seconds to completely remerge the data with the form.  Which feels a bit of a heavy handed way to make the drop down lists recognise that they now have data.

If I remove the xfa.host.remerge() command the form starts up in a under ten seconds, which is the sort of performance that is required. But the drop down lists are not populated.

I have spent a couple of days pouring over the forums with no joy.

So my question is two fold, is there a better way to load the drop down lists with WSDL data so they find the data, and if not, is there a way to make the drop down lists in question refresh without touching the whole form?

3 Replies

Avatar

Level 3

I could be wrong here , but if this is a dynamic form, and binding is in place, the data merge should be happening automatically, it's probably just the layout rendering needs to be happen again.

Can you try if xfa.layout.relayout() makes a difference.

Avatar

Level 1

Hi Sid,

Thanks for the prompt reply.  I have just tried it and alas it didn't have the desired outcome.

The drop downs are bound to data nodes in the underlying schema.  But the elements they bind to are empty when the initial xml data is supplied to the form template. 

When the docReady event is triggered, it makes a series of SOAP calls to retrieve the data, which it then stores in the xml against the bound nodes.  In my experience any field that is bound to a data node automatically refreshes.  That said, for some reason these drop down boxes are not refreshing when the data nodes are refreshed with the SOAP response.

It seems the only way to make the drop down's notice that the data has been refreshed is to do a remerge which is very heavy handed and given the size and complexity of the forms means that it can take quite a while.

I have seen some examples where you can specify the dropdown list as part of the call and the response is effectively added to the drop down box as it comes in, which seems to defeat the point of using data binding.  My SOAP calls are all abstracted away from the form objects, but if that is the only way to avoid a costly remerge, then I will find a way to do that.

Any thoughts?

Avatar

Level 10

Hi there,

There is a work around which you can use but might not be the best option, but here it goes...

you can use an array which holds the list items as default, and when you want to refresh the drop down list to its default items, you can use this

Hope this help!