Popup 3.0 - hide field if value=null

4655
10
Jump to solution
09-27-2012 09:21 AM
philippschnetzer
Occasional Contributor III
using the latest flaxviewer 3.0.  I would like my popups to hide fields if they do not contain a value. Can this be done easily? I'm assuming it will need to happen in the mxml and not the xml, correct? Thanks
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
DasaPaddock
Esri Regular Contributor
Yes, you need to create a custom PopUpRendererSkin. Try making this change to line 163 of PopUpRendererSkin.mxml:

    if (fieldInfo.visible && formattedAttributes[fieldInfo.fieldName])

PopUpRendererSkin.mxml is in the skins folder inside the API's zip file.

View solution in original post

0 Kudos
10 Replies
DasaPaddock
Esri Regular Contributor
Yes, you need to create a custom PopUpRendererSkin. Try making this change to line 163 of PopUpRendererSkin.mxml:

    if (fieldInfo.visible && formattedAttributes[fieldInfo.fieldName])

PopUpRendererSkin.mxml is in the skins folder inside the API's zip file.
0 Kudos
GeorgeHaskett
Occasional Contributor III
Is it possible to do this if you are using the Flex Viewer 3.0 in compiled mode using xml?

I'm new to Flex and am currently customizing widgets in I believe the compiled mode.

How difficult would it be to figure out the option you mentioned previously and what software is best to use when editing the code?

Thanks,
0 Kudos
DasaPaddock
Esri Regular Contributor
You'll need to recompile the Viewer to make any changes to mxml source files.

See:
http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Flex_development/01m30000002000...
0 Kudos
GeorgeHaskett
Occasional Contributor III
Thanks,

Haskett
0 Kudos
RhettZufelt
MVP Frequent Contributor
Yes, you need to create a custom PopUpRendererSkin. Try making this change to line 163 of PopUpRendererSkin.mxml:

    if (fieldInfo.visible && formattedAttributes[fieldInfo.fieldName])

PopUpRendererSkin.mxml is in the skins folder inside the API's zip file.


Hi Dasa,

was wondering if there is anything else one needs to do to make this happen? 

I have made the change to my PopUpRenderSkin.mxml, but I still get fields in my popup that have null values:

[ATTACH=CONFIG]18124[/ATTACH]

Thanks,

R_
0 Kudos
DasaPaddock
Esri Regular Contributor
Rhett,

It looks like all the fields in your screenshot have values.
0 Kudos
RhettZufelt
MVP Frequent Contributor
Whoops, clicked on the wrong well.

[ATTACH=CONFIG]18125[/ATTACH]

However, after re-boot, re-clear everything, it seems to be working now.

[ATTACH=CONFIG]18126[/ATTACH]

Thanks for the help,

R_
0 Kudos
RhettZufelt
MVP Frequent Contributor
Yes, you need to create a custom PopUpRendererSkin. Try making this change to line 163 of PopUpRendererSkin.mxml:

    if (fieldInfo.visible && formattedAttributes[fieldInfo.fieldName])



Hi Dasa,

In several of my data sets, I often end up with a space in the "empty" cells.  Is there a way to modify this so that a single space is also filtered out as well as blanks and Nulls?

Thanks again,

R_
0 Kudos
DasaPaddock
Esri Regular Contributor
Try:

if (fieldInfo.visible && formattedAttributes[fieldInfo.fieldName] && formattedAttributes[fieldInfo.fieldName] != " ")
0 Kudos