|
POST
|
I ended up solving my own problem. I just created a copy of the index.mxml and called it secure.mxml and each load on a different state. Logging In and Logging out will determine which one you get. I figured I would post this in case anybody cares.
... View more
05-02-2012
12:48 PM
|
0
|
0
|
473
|
|
POST
|
My index.mxml has two states a login state and viewer state. As of now my viewer opens in the login state, but my goal is the opposite. I want to keep the login functionality I have, and implement it a little differently. I need the viewer to load in the viewer state but then have a login button that switches to the login state when clicked. My plan was to have a function that made currentState = "Login" in the index.mxml and then have a button or label within the HeaderControllerWidget.mxml that could be clicked wich would then call the funcion. My problem is the header controller part. I am not quite sure how to import a function that is in the index.mxml. If anyone could help with that, or tell me that my logic is off and there is a better way of doing it, I would really appreciate it.
... View more
05-01-2012
05:18 PM
|
0
|
3
|
682
|
|
POST
|
Robert, I have input your additions and it is now working beautifully! I still have to input the rest of my match fields but I don't see any problems coming up. I will let you know how it turns out. I really appreciate you taking the time to look into this further for me. Thanks,
... View more
03-05-2012
06:31 AM
|
0
|
0
|
581
|
|
POST
|
I have over 50 variables in the skin. But if you could show me one or two then I will probably be able to take it from there. All I want to do is to have the popup turn a specified string into a clickable link. The skin used flex regular expression to match the strings and then converted them to a hyperlink. I have attached a picture that shows what the popups does (notice the CFD, SLD, LMD fields) . [ATTACH=CONFIG]12382[/ATTACH] I want to do the same exact thing for the popups in the search widget. So the end result is if I have the field turned on in the xml then those fields will be links as well. Here are three of the values that I am searching for as well as the urls I'm using. var match:Array = htmlText.match(/^\s*((https?|ftp):\/\/\S+)\s*$/i);
var matchTwo:Array = htmlText.match("LMD 1");
var match3:Array = htmlText.match("LMD 2");
var match24:Array = htmlText.match("LMD 1, LMD 5");
if (match && match.length > 0)
{
label = new mx.controls.Label();
htmlText = '<a href="' + match[1] + '" target="_blank">' + match[1] + "</a>";
} else if (matchTwo && matchTwo.length > 0){
label = new mx.controls.Label();
htmlText = '<a href="http://www.cityofrc.us/cityhall/admin/gis/districts/landscape/1.asp" target="_blank">' + '<b>LMD 1</b>' + "</a>";
}else if (match3 && match3.length > 0){
label = new mx.controls.Label();
htmlText = '<a href="http://www.cityofrc.us/cityhall/admin/gis/districts/landscape/2.asp" target="_blank">' + '<b>LMD 2</b>' + "</a>";
}else if (match24 && match24.length > 0){
label = new mx.controls.Label();
htmlText = '<a href="http://www.cityofrc.us/cityhall/admin/gis/districts/landscape/1.asp" target="_blank">' + '<b>LMD 1</b>' + '</a>' + ' ' + '<a href="http://www.cityofrc.us/cityhall/admin/gis/districts/landscape/5.asp" target="_blank">' + '<b>LMD 5</b>' + "</a>";
} I figured I would just show the code to make it easier. If it helps, one of the fields that contains these values is "LMD_NAME" All possible values: LMD 1 LMD 2 LMD 3A LMD 3B LMD 4-R LMD 5 LMD 6-R LMD 7 LMD 8 LMD 9 LMD 10 LMD 1, LMD 5 LMD 3A, LMD 3B I'm sorry for the inconvenience, usually I can figure this stuff out myself without further instructions. Thank you for all of your help!
... View more
03-01-2012
03:03 PM
|
0
|
0
|
581
|
|
POST
|
Andrea, Unfortunately no I haven't been able to get this functionality working within the search widget popups. It is working wonderfully within the independent popups. But I might lack the programming skills to get this to work. I am still rather dependent on looking at examples and then just manipulating the code. This might take a little bit more than that. If you would like you can grab the skin I modified, its in one of the above posts to Robert. Hopefully Robert will be able to help me some more. Robert, I am having a hard time making this work. I have looked the createSearchResults function up and down but its probably my lack of flex knowledge that is preventing me from making the necessary additions to the widget. I am not sure where within that function I am supposed to add those match variables, or how to make them work outside of the PopUpRendererSkin all together. Any help you would be willing to provide would be greatly appreciated. Thanks,
... View more
03-01-2012
02:02 PM
|
0
|
0
|
1139
|
|
POST
|
Ive spent a good bit of the day looking at the code and I keep wanting to try and change something in the cofigurePopUpInfo function. When you said to use the createSearchResults function did you mean try adding the same kind of match variable to that function as I did in the skin. That way the html going to the popUpInfo.description would be formatted into a link. Or I am completely off on what you were saying. Im probably pretty confused on how to do this because asking this question is even confusing me. Sorry about that.
... View more
02-28-2012
01:02 PM
|
0
|
0
|
1139
|
|
POST
|
After adding some breakpoints it looks like the popupskin is getting accessed. I added a break point around my additions as well and it seems that it is hitting the break points all the way up to the red text, anything after the red text doesnt trigger any break points. (Note:The red text itself is triggering) (Another Note: I had to remove most of my variables that are looking for the text for this post, it was too long. I have also attached the whole file just in case.) override protected function commitProperties():void
{
super.commitProperties();
var featureLayer:FeatureLayer = hostComponent.featureLayer;
var formattedAttributes:Object = hostComponent.formattedAttributes;
var graphic:Graphic = hostComponent.graphic;
var map:Map = hostComponent.map;
var popUpInfo:PopUpInfo = hostComponent.popUpInfo;
var validMediaInfos:Array = hostComponent.validPopUpMediaInfos;
var geometry:Geometry = graphic ? graphic.geometry : null;
var layerDetails:LayerDetails = featureLayer ? featureLayer.layerDetails : null;
vGroup.removeAllElements();
if (popUpInfo)
{
if (popUpInfo.title)
{
titleLabel.text = StringUtil.substitute(popUpInfo.title, formattedAttributes);
if (titleLabel.text)
{
vGroup.addElement(titleLabel);
vGroup.addElement(titleLine);
}
}
var htmlText:String;
if (popUpInfo.description)
{
htmlText = StringUtil.substitute(popUpInfo.description, formattedAttributes);
if (htmlText)
{
cleanAndSetHtmlText(descriptionText, htmlText);
vGroup.addElement(descriptionText);
}
//Fix for the 2.3.x popup text color bug RJS
descriptionText.styleSheet = textStyleSheet;
}
else
{
vGroup.addElement(descriptionForm);
descriptionForm.removeAllChildren();
for each (var fieldInfo:PopUpFieldInfo in popUpInfo.popUpFieldInfos)
{
if (fieldInfo.visible)
{
var formItem:FormItem = new FormItem();
formItem.label = fieldInfo.label || fieldInfo.fieldName;
var label:mx.controls.Label;
htmlText = formattedAttributes[fieldInfo.fieldName];
if (htmlText)
{
// convert attribute field values that just contain URLs into links
var match:Array = htmlText.match(/^\s*((https?|ftp):\/\/\S+)\s*$/i);
//convert attribute field values that contain specified values into links
var match24:Array = htmlText.match("LMD 1, LMD 5");
var match25:Array = htmlText.match("LMD 3A, LMD 3B");
var matchTwo:Array = htmlText.match("LMD 1");
var match3:Array = htmlText.match("LMD 2");
if (match && match.length > 0)
{
label = new mx.controls.Label();
htmlText = '<a href="' + match[1] + '" target="_blank">' + match[1] + "</a>";
} else if (match24 && match24.length > 0){
label = new mx.controls.Label();
htmlText = '<a href="http://www.cityofrc.us/cityhall/admin/gis/districts/landscape/1.asp" target="_blank">' + '<b>LMD 1</b>' + '</a>' + ' ' + '<a href="http://www.cityofrc.us/cityhall/admin/gis/districts/landscape/5.asp" target="_blank">' + '<b>LMD 5</b>' + "</a>";
}else if (match25 && match25.length > 0){
label = new mx.controls.Label();
htmlText = '<a href="http://www.cityofrc.us/cityhall/admin/gis/districts/landscape/3A.asp" target="_blank">' + '<b>LMD 3A</b>' + '</a>' + ' ' + '<a href="http://www.cityofrc.us/cityhall/admin/gis/districts/landscape/3B.asp" target="_blank">' + '<b>LMD 3B</b>' + "</a>";
}else if (matchTwo && matchTwo.length > 0){
label = new mx.controls.Label();
htmlText = '<a href="http://www.cityofrc.us/cityhall/admin/gis/districts/landscape/1.asp" target="_blank">' + '<b>LMD 1</b>' + "</a>";
}else if (match3 && match3.length > 0){
label = new mx.controls.Label();
htmlText = '<a href="http://www.cityofrc.us/cityhall/admin/gis/districts/landscape/2.asp" target="_blank">' + '<b>LMD 2</b>' + "</a>";
}else{
label = new Text();
}
cleanAndSetHtmlText(label, htmlText);
label.selectable = true;
label.styleSheet = this.textStyleSheet;
label.width = 350;
formItem.addChild(label);
}
descriptionForm.addChild(formItem);
}
}
}
if (validMediaInfos && validMediaInfos.length > 0)
{
vGroup.addElement(mediaBrowser);
mediaBrowser.attributes = graphic.attributes;
mediaBrowser.formattedAttributes = formattedAttributes;
mediaBrowser.popUpFieldInfos = popUpInfo.popUpFieldInfos;
mediaBrowser.popUpMediaInfos = validMediaInfos;
}
if (popUpInfo.showAttachments && graphic && featureLayer
&& layerDetails && layerDetails.hasAttachments && layerDetails.objectIdField)
{
vGroup.addElement(attachmentInspector);
attachmentInspector.showAttachments(graphic, featureLayer);
}
if (map && geometry)
{
vGroup.addElement(zoomToButton);
}
}
} Any Ideas?
... View more
02-28-2012
06:50 AM
|
0
|
0
|
1139
|
|
POST
|
Yep its exactly like that, except my custom skin is located outside of the widget folder. Im not sure that it makes a difference or not? private function showHighlight(params:Array):void
{
var showHighlightPoint:MapPoint = params[0].point as MapPoint;
popUpRenderer.popUpInfo = configurePopUpInfo(params[0].graphic.attributes.link, params[0].graphic.attributes.linkalias);
popUpRenderer.graphic = params[0].graphic;
popUpRenderer.setStyle("skinClass", com.esri.ags.skins.PopUpRendererSkin);
map.infoWindow.content = popUpRenderer;
map.infoWindow.contentOwner = popUpRenderer.graphic;
map.infoWindow.show(showHighlightPoint);
} If I close the widget and click on a parcel the all of the fields work great. As soon as I open the eSearch widget the fields are not links any more. It is the same skin being used for both of them. Once again im not sure that matter either? Im just trying to give you as much info as possible. Does it maybe have something to do with the search widget config? I only think this because it determines what shows up in the popups when the search widget is open.
... View more
02-28-2012
05:51 AM
|
0
|
0
|
1139
|
|
POST
|
After editing the PopUpRendererSkin I have been able to have my popups listen for a specified attribute value and make them a click able hyperlink (even if the field itself is not a URL). I have had the popups with the links working great for a while now. My question is getting them to work with the search widget. I have been using a few different search widgets including the eSearch widget. But they all seem to do the same thing, even though I am pointing the widget to the PopUpRendererSkin it doesn't seem to convert the specified values into links. I know this probably has something to do with the search widget using the xml to configure its popup but if any body could help me out I would be really grateful! Thanks,
... View more
02-28-2012
05:13 AM
|
0
|
13
|
3564
|
|
POST
|
Never mind after some combing through the forums I saw that Robert had already answered this. http://forums.arcgis.com/threads/22321-Flex-2.2-Favicon?highlight=favicon
... View more
02-27-2012
03:55 PM
|
0
|
0
|
498
|
|
POST
|
I would like to use a favicon for my flexviewer. Currently I export release build and then go into the index.html and add the line of code that makes the favicon work. Is there an easy way to just add this into flash builder somehow so when I export release build it enters the line of code for me and saves me a step. Any help is always appreciated. Thank You,
... View more
02-27-2012
03:50 PM
|
0
|
3
|
3162
|
|
POST
|
Robert, Its been a little while since I asked you the question above, but I wanted to see if you could help me with one more thing on this topic. I have had the popups with the links working great for a while now. My question is getting them to work with the search widget. I have been using a few different search widgets including your eSearch widget. But they all seem to do the same thing, even though I am pointing the widget to the PopUpRendererSkin it doesn't seem to convert the specified values into links. I know this probably has something to do with the search widget using the xml to configure its popup but if you could help me out I would be really grateful! Thanks,
... View more
02-27-2012
01:26 PM
|
0
|
0
|
654
|
|
POST
|
Thanks Robert! It worked perfectly! Now I just have to learn the regular expression syntax used to match my string fields. I should be able to figure that part out though. Your help is greatly appreciated, as always!
... View more
02-16-2012
01:45 PM
|
0
|
0
|
654
|
|
POST
|
Awesome thanks Robert! I got it working pretty quickly but I am having a few issues. As soon as I add another variable under the "match" variable my popups have duplicates fields all the way down. Both fields are changed to URLs and work properly but I have duplicates now. For example if my popup used to have a field that was "District: SLD 1" Now it says "District: SLD1" with another "SLD 1" directly under it but it does that with every field in the popup click able or not. If I delete my code additions or the original var that looks for the URL field it all works. It has something to do with me copying the original and then filling in what I needed. I must have missed something. If you could take a look at it I would appreciate it. I would like to be able to add numerous variables that I can use for multiple fields. I have included some of the code I was messing with for you to look at. Thanks! var formItem:FormItem = new FormItem();
formItem.label = fieldInfo.label || fieldInfo.fieldName;
var label:mx.controls.Label;
htmlText = formattedAttributes[fieldInfo.fieldName];
if (htmlText)
{
// convert attribute field values that just contain URLs into links
var match:Array = htmlText.match(/^\s*((https?|ftp):\/\/\S+)\s*$/i);
if (match && match.length > 0)
{
label = new mx.controls.Label();
htmlText = '<a href="' + match[1] + '" target="_blank">' + match[1] + "</a>";
}
else
{
label = new Text();
}
cleanAndSetHtmlText(label, htmlText);
label.selectable = true;
label.styleSheet = this.textStyleSheet;
label.width = 350;
formItem.addChild(label);
//my additions
var matchTwo:Array = htmlText.match('GREENBRIAR');
if (matchTwo && matchTwo.length > 0)
{
label = new mx.controls.Label();
htmlText = '<a href="http://www.google.com" target="_blank">' + matchTwo + "</a>";
}
else
{
label = new Text();
}
cleanAndSetHtmlText(label, htmlText);
label.selectable = true;
label.styleSheet = this.textStyleSheet;
label.width = 350;
formItem.addChild(label);
//end my additions
}
descriptionForm.addChild(formItem);
}
}
}
... View more
02-16-2012
12:49 PM
|
0
|
0
|
654
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-28-2018 05:23 PM | |
| 1 | 10-17-2019 05:08 PM | |
| 1 | 02-25-2020 02:42 PM | |
| 1 | 12-18-2018 09:17 AM | |
| 1 | 01-25-2018 08:08 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-29-2021
12:06 PM
|