could i show a linkurl in livelayerwidget using flexview

383
2
05-27-2010 01:35 AM
dengxunfei
New Contributor
i used the livelayerwidget.mxml and livelayerwidget_trafficcameras.xml, and i fixed the picture in my appliction. how ever, i just want add a link button or link image which will direct to a new webpage when click it.

i get some changes in livelayerwidget_trafficcameras.xml
--
<configuration>
<layer>http://localhost/ArcGIS/rest/services/zjOcean/MapServer/1</layer>
<query>OBJECTID> 0</query>
<fields>NAME,IMGURL</fields>
<titlefield>NAME</titlefield>
<filterfield>
       <name></name>
       <alias></alias>
    </filterfield>
<linkfield>IMGURL</linkfield>
<urlfield>NAME</urlfield>
<refreshrate></refreshrate>
<zoomscale>50000</zoomscale>
</configuration>
how can i make changes in the livelayerwidget.mxml, to fix it in the right way. can somebody give me some advices, any suggestion will be appreciated.

---
afeiarcims
Tags (2)
0 Kudos
2 Replies
dengxunfei
New Contributor
i want to do something just like the attachments shows(just as the right link image),  this function i change  searchwigets,and made it work. but when i use the same way to check it out here, unfortunately, it didnt work.

some changs in liverlayerwidget as follows:

// using as link to detail info
private var queryURLField:String;

// in init()
if (configXML)
{
   skip....
   queryURLField = configXML.urlfield;

...
}

// and in
//create record data new
private function createRecordData(featureSet:FeatureSet):ArrayCollection
{
...
   for each (var gra:Graphic in featureSet.features)                   
{  
var obj:Object = gra.attributes;
var fld:String;
var value:String;
var title:String;
var content:String = "";
var link:String = "";
var webUrl:String =""; // add for show detail info link -- afei

...
}

...
var infoData:Object =
{
icon: icon,
title: title,
content: content,
link: link,
webUrl: webUrl, // add for url
point: point,
geometry: gra.geometry
};    

...

thank you very much in advance for any suggestion.
0 Kudos
dengxunfei
New Contributor
Hi, for several days work, I finally got it to work when i get some help from ESRI forum and make some changes of my own. this files(attach behind) works for image and detail link to new web page in my application. I post them,may be some one have the similar sense would be helpful.

The detail code attached below(3files in rar file:InfoPopup.mxml,LiveLayerWidget.mxml,LiveLayerWidget_view.xml),this work got a great help from Greg Knight, and of course, the most code are from ESRI AGS Team.

1. change the code in config.xml, add or change the following one.

<widget label="viewing" icon="com/esri/solutions/flexviewer/assets/images/icons/i_camera.png" menu="menuApp" config="com/esri/solutions/flexviewer/widgets/LiveLayerWidget_view.xml">com/esri/solutions/flexviewer/widgets/LiveLayerWidget.swf</widget>

2. get more changes with the guide of attachments.


---
afeiarcims.
0 Kudos