Problem developing ArcGIS Flex Viewer Widget configuration

3877
16
07-01-2015 07:26 AM
AmazingMapMan
New Contributor III

Hello,

I created a custom widget for the ArcGIS Viewer for Flex.

The widget works an I am able to deploy it as a ZIP file and ship it to (test-)customers.

The ugly part:

If you import that widget into an ArcGIS Viewer for Flex to publish it with your Map and want to configure it, the Viewer only shows the content of the xml-configuration file instead of a fancy UI.

ViewerScreenshot.png

To get around that, I created a UI-"Module" for my widget, as it is explained here:

Custom Modules for Application Builder · Esri/arcgis-viewer-builder-flex Wiki · GitHub

That works quite well:

CustomMenu.png

The problem is, when I import this custom Widget with the Module, my Widget Icon is not displayed.

The icon is packed in the "assets/images" folder of my widget-zip-file.

I can't figure out how to access the assets folder to correctly display the icon for the widget.

MissingIcon.png

When I deploy the widget without the custom-config-ui module the icon is displayed correctly.

(See first screenshot)

Did anyone try to create such a custom-widget-configuration-ui?

Any hints on what i am doing wrong?

Is there an other way to create a custom configuration window?

If needed I can provide sourcecode.

Greetings!

Tags (1)
0 Kudos
16 Replies
RobertScheitlin__GISP
MVP Emeritus

Amazing Mapman,

   I am confused, you have this question marked as "Assumed Answered"... Do you still have a question?

0 Kudos
AmazingMapMan
New Contributor III

Hello,

the question is not answerd.

I think I accidently clicked on "mark as answerd".

Can i undo that somwhere?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

OK,

  I have produced several widget that have a UI for app builder and the icon appears fine. I set the icon location in the module.as

        public function get widgetIconLocation():String
        {
            return 'assets/images/Aloha2.png';
        }

Bu this assumes that you have a assets/images folder in your widgets main folder:

src\widgets\AlohaThreatZone\assets\images\Aloha2.png

Because when I tries to resolve assets/images it is looking from the path of the swf that the code is running from.

PS. don't worry about the "Assumed Answered" you can always click on the "Correct Answer" link (the one with the little green star) on the reply that actually answers your question.

0 Kudos
AmazingMapMan
New Contributor III

Well,

this is exacly how I do it:

public function get widgetIconLocation():String
        {
            LOG.debug("widgetIconLocation");
            return "assets/images/ALKISBuch_green20.png";
        }

Widget Folder:

Widget.png

Assets:

Assets.png

I tried different Images (gif, png, jpg), but no success.

Its really strange.

0 Kudos
LisaTurner
Occasional Contributor II

In your return line you used " " and in Robert's it has ' '. Does that make a difference?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Lisa,

  I don't think that would make a difference. Nice catch though.

RobertScheitlin__GISP
MVP Emeritus

That is strange. Have you verified that the actual zip file of your widget that is used to import into app builder contains the png file in the assets/images folder? There are time when you embed a png in your code that the compiled skips adding the png image to the bin-release as it is already embeded in the code.

0 Kudos
AmazingMapMan
New Contributor III

Yes, I checked that.

It definetly gets imported into the FlexViewer:

FlexViewer.png

What puzzles me most is that the icon is displayed when i omit the "ui-module" from the ZIP-file.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Amazing Mapman,

  Do you have the icon in the BuilderRecouces folder?

i.e. AppBuilder3.7\BuilderResources\flexviewer\widgets\AlohaThreatZone\assets\images\Aloha2.png

0 Kudos