Select to view content in your preferred language

Run a widget without config.xml

4219
4
Jump to solution
02-09-2015 04:24 AM
VanessaPinto1
Deactivated User

Hello,

I am trying to implement the "Print Widget" in this application right here:
http://www.arcgis.com/home/item.html?id=442c350d47644325a99ad04a85733117

The problem is this application does not have a config.xml neither a 'widgetcontainer' so I don't know how to call it in the application.

I've tried to call it by:

  1. SiteContainer.dispatchEvent(new AppEvent(AppEvent.WIDGET_MENU_CLICKED,false, false, PrintWidget)); 

but it doesn't work because I can't recognize the PrintWidget.xml.

Did someone ever try to do something like this?

Thanks in advance,

Vanessa

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Vanessa,

The code you are trying to use both to launch the widget and the widget itself are dependent on the ArcGIS Viewer for Flex code base.  The only way to do this is to be an experienced programmer and attempt to decouple the portions of the print widget that is dependent on the Viewer and then use the popup manager to display the UI or something.

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus

Vanessa,

  What version of Flex Viewer are you using? Looking at your code that is for an older version of the viewer.

This is what your code should look like in 3.x:

var id:Number = ViewerContainer.getInstance().widgetManager.getWidgetId("PrintWidget");
AppEvent.dispatch(AppEvent.WIDGET_RUN, id);
0 Kudos
VanessaPinto1
Deactivated User

Robert,

Thank you for answering so quickly...

I tried this way too and It didn't work.
The problem is the application was not running with the Flex API.
I have a html/flex application and I want to implement a Flex API widget in it.

Do you think is it possible to do that?

Thanks,

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Vanessa,

The code you are trying to use both to launch the widget and the widget itself are dependent on the ArcGIS Viewer for Flex code base.  The only way to do this is to be an experienced programmer and attempt to decouple the portions of the print widget that is dependent on the Viewer and then use the popup manager to display the UI or something.

VanessaPinto1
Deactivated User

Robert,

I implemented the Print widget in the application just like you said... "decouple the portions of the print widget that is dependent on the Viewer and then use the popup manager to display the UI or something."

and now It's working!

Thank you for your help!

0 Kudos