I wrote a function that will be executed before page load (beforePageLoad()) inside a custom control. The custom control is only used once in an XPage. But I noticed that it is being executed multiple times (2 - 4 times, different number of times).
<xp:this.dataContexts>
<xp:dataContext var="filterOptions">
<xp:this.value><![CDATA[#{javascript:getFilterOptions("wvAP");}]]></xp:this.value>
</xp:dataContext>
</xp:this.dataContexts>
<xp:this.beforePageLoad><![CDATA[#{javascript:beforePageLoad();}]]></xp:this.beforePageLoad>
I used a function too inside a dominoView search property and same thing happens (control is also used once in the page):
<xp:this.data>
<xp:dominoView var="viewBP" viewName="wvBP"
ignoreRequestParams="true"
search="${javascript: getSearchQuery(); //on page reload because if dynamic, called 4x}">
</xp:dominoView>
</xp:this.data>
I already set it to on page load only, but it still runs multiple times. What do you think I'm doing wrong here? Or am I missing a config or something? Thanks!