How many times does the popup widget executes??
I made a custom widget using the popup widget I only need to add something in the resulting HTML that the widget returns, but only once.
I noticed that it executes many times and not only one.
The popup component in the other hand is executing only one time, thats ok.
I cant quite understand how this widget works.
Is there anyway to do this?
Pinned topic How many times does the popup widget executes??
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2013-01-22T19:55:09Z at 2013-01-22T19:55:09Z by P8GM_alejandro_amen
tmparker 120000EHB3534 Posts
Re: How many times does the popup widget executes??2013-01-22T15:25:34ZThis is the accepted answer. This is the accepted answer.Hi Alejandro,
If you wrote a custom widget and have code that you want added to the HTML in the widget, this will happen every time we generate an instance of the widget. The widget is designed to be stand alone and it doesn't know about any other widget on the page already. So each time this widget needs to be displayed on the page we will generate the code for the widget the same way. When you say the component code is executing once it sounds like you are saying you are doing a default transformation and have this component/widget added as one of the rules. In that case, yes, we only do one pass at finding all instances on the screen that match this rule. However, once we do that it may generate several widgets if there are multiple places that are recognized.
P8GM_alejandro_amen 270003P8GM34 Posts
Re: How many times does the popup widget executes??2013-01-22T19:55:09ZThis is the accepted answer. This is the accepted answer.
- tmparker 120000EHB3
Yes, you are correct, I've made a custom component and a custom widget as well and using them in a default transformation.
So, the dialog component must be returning not the dialog itself but all the components inside it for the widget to render, and not a "dialog" component as I suposed.
I've found a solution by setting a gv in my custom component and checking it on the widget side so it only runs once, i think that this will do the trick.
Thanks for your quick and exelent answer!