Run a widget after page load

393
3
Jump to solution
06-03-2012 05:58 PM
FarhadNavaei
New Contributor III
Hi,

I need to run a widget right after a page is completely loaded. Is there any way to do that?

Thanks
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AnthonyGiles
Frequent Contributor
Fnavaei,

If you are using the viewer and you want a widget to run/open automatically use the tag preload="open" in the main config file when you set the widget tag

Regards

Anthony

View solution in original post

0 Kudos
3 Replies
AnthonyGiles
Frequent Contributor
Fnavaei,

If you are using the viewer and you want a widget to run/open automatically use the tag preload="open" in the main config file when you set the widget tag

Regards

Anthony
0 Kudos
FarhadNavaei
New Contributor III
Would you please explain it in a little details? I used the following code in widgetConfigLoaded event. It seems OK, but I'm not sure if it is right thing to do.

ViewerContainer.dispatchEvent(new AppEvent(AppEvent.WIDGET_RUN, 0));

Thanks
0 Kudos
IvanBespalov
Occasional Contributor III
Farhad,

in FlexViewer versions 2.1, 2.2, 2.3:
ViewerContainer.dispatchEvent(new AppEvent(AppEvent.WIDGET_RUN, id));

in FlexViewer versions 2.4, 2.5, 3.0:
AppEvent.dispatch(AppEvent.WIDGET_RUN, id);
0 Kudos