Select to view content in your preferred language

Adding/Opening User-selected widgets

718
4
Jump to solution
03-13-2014 11:28 AM
AndrewBlakey
Deactivated User
Hi all:

I have a simple use case but I'm not sure how to circumvent the Flex Viewer design to do so.

I have two basic widgets that sit beside the map frame. Neither have the widget frame, icon, etc.   I want the application to start up showing neither and ask the user which one to display. Upon choice, the application will load and display that one, which being a static size and position, will fill the gap beside the map frame.

How can I load in a widget and display it AFTER the application has initialized?

My workaround is to load both, and hide it all with a panel that shows up. Upon selection, the panel disappears and I use events to hide the one I don't want.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Andrew,

   Your situation is pretty unique, so you will need to add the widgets back to the sandard widgets container and just prevent the HeaderControllerWidget for making a button for the widgets by inspecting the widgets array for the widgets label and if it equals one of your widgets then you do not add the button.

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Andrew,

  Just use:

AppEvent.dispatch(AppEvent.WIDGET_RUN, id);
0 Kudos
AndrewBlakey
Deactivated User
Hi Robert:

This makes sense but I'm stuck at how to tell FlexViewer what the widget is (and therefore have it assigned an ID) without it loading and running.  I currently have the widget listed in the ViewerUI section of config.xml.  Everything I list in this section is loaded displayed on startup.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Andrew,

   Your situation is pretty unique, so you will need to add the widgets back to the sandard widgets container and just prevent the HeaderControllerWidget for making a button for the widgets by inspecting the widgets array for the widgets label and if it equals one of your widgets then you do not add the button.
0 Kudos
AndrewBlakey
Deactivated User
Hi Robert:

The Flex Viewer is a fairly complex beast with what I think is too little commenting.  Your guidance has once again helped me identify where to focus my modification efforts.  I've added a new config parameter for widgets asking whether to show or hide them from the HeaderControllerWidget and it works great.

Thanks again for your help.
0 Kudos