0
votes

I have a very long xpage-based form which needs completing so I decided to break it down into a set of panels, each of which is rendered or not based on the checked values in a checkbox group.

My issue is that the larger panels (containing 30 or so fields) take over 20s to display using a partial refresh on the onchange event handler of the checkbox field. I assumed this was just down to the amount of content, but if I remove the render formula completely from all panels, the whole form including all panel content initially displays in just a few seconds.

The structure is:

<xp:panel id="allPanels">
   <xp:panel id="panel1"></xp:panel>
   <xp:panel id="panel2"></xp:panel>
   <xp:panel id="panel3"></xp:panel>
</xp:panel>

with the onchange event refreshing "allPanels".

Does anybody have any ideas why there is such a delay as it is currently unusable!

Many thanks

2
The format is fine, the question is what are the individual panels doing that is taking so long. That is the source of the delay. - Eric Tomenga
Profile your application to find out what makes it slow - Frantisek Kossuth
is there dblookup like functions in fields? someviews works very slow... you can investigate @today like functions in views maybe... - yunusy
You could always try removing a panel and its content from your page, one by one, then putting them back in, to see if you can pinpoint if it is one particular panel causing the bulk of the delay? From there, we would then know where to investigate further - Chris Richards
Thanks for the responses all. I have narrowed it down to one particular panel which contains the most fields by a distance. All I can see is 5x db lookups but these are to a keywords view in the same db with only a handful of docs. It also wouldn't explain why the panel takes 20s for a partial refresh of allPanels but only 1-2s on initial render. I guess I'll have to go the profile app route as suggested by Frantisek unless I'm missing something obvious. - crispy235

2 Answers

1
votes

@DbLookup is particularly bad for performance, you'll see that in various blog posts available. See for example xPages @DbLookup issue. APIs that don't use formula language will be better performant - there is no formula language engine in XPages, everything is Java. SSJS maps to Java methods; @DbLookups map to multiple Java methods (for each of the parameters).

Also see my webinar "Marty, You're Not Thinking Fourth Dimensionally" (2016 Webinars tab at http://www.tlcc.com/admin/tlccsite.nsf/pages/recorded-xpages-webinars). What is calculated when is a topic I've talked about over a number of years, and it explains exactly why it's quicker on initial load. There are various options for improving performance. "Compute on Page Load" rather than "Compute Dynamically" is preferable. view.isRenderingPhase() can be used to minimise the number of computations, where appropriate. Another option may be to run code in the onClick to set viewScope variables and reference those, rather than running lookups in situ.

0
votes

You could try adding execId="YOURCHECKBOXFIELDID" to the event handler of your checkbox group which will only send the value of your checkbox to the server for partial refresh, not all other fields.

Also, take a look at the answer I gave to a similar question here: Complex Xpage takes long for partial refreshs which might help?

Infact I've just noticed Knut mentioned the execId point as a response to the above question also!