Select to view content in your preferred language

Date Search (Flex Widget) - Cannot zoom to record...help!

5553
8
03-26-2015 09:58 AM
JesseHopkins
Regular Contributor

Hey everyone,

I recently found a widget that Robert S. had created to search a layer on date ranges, however I am having issues trying to get the zoom and ping functionality working.  I'm not the most adept in the Flex department, however I managed to upgrade the code and make the necessary changes to get it working (pre 4.0 sdk).  That being said, this thing is archaic, and there may be a decent amount of code that is just not needed.  Anyways,I attached a few images that may help show the basic functionality of the widget; on the second image I circled the buttons that are not functioning correctly.  Also attached is the .mxml.

Thanks,

Jesse

0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus

Jesse,

  From the looks of your code the zoomAndHighlight portion has been commented out!

            /*private function zoomAndHighlight(infoData:Object):void //does not work
            {
                //showHighlight(infoData);
                setMapExtent(infoData, graphicsLayer.graphicProvider as Array); 
            }*/    
            
            private function zoomToFeature(event:AppEvent):void //does not work
            {
                // Check to see if the event was fired by results from this widget
                if (!event.data.widget || event.data.widget.toString() != widgetTitle) return;
                
                if (recAC && recAC.length > 0)
                {
                    var index:Number = recAC.getItemIndex(event.data);
                    if (index != accordion.selectedIndex)
                    {
                        accordion.selectedIndex = index;
                        
                        //set the container scrollbar to show all of this record
                        var header:mx.controls.Button = accordion.getHeaderAt(index);
                        var headerHeight:Number = header.height;
                        resultsViewport.verticalScrollPosition = accordion.y + accordion.selectedChild.y - headerHeight;
                    }
                }
                //zoomAndHighlight(event.data);
            }
0 Kudos
JesseHopkins
Regular Contributor

Hi Robert,

Ha yeah I forgot to un-comment that out, however, even with that it still doesn't work properly. It seems that nothing on the results tab (top right corner - circled in second image) wants to work.

Thanks,

Jesse

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Does just clicking on the result zoom? Can you attach the com.esri.viewer.components.RecordDataB for me to look at?

0 Kudos
JesseHopkins
Regular Contributor

No, unfortunately clicking on the record does not zoom either.  That's pretty much all I need too.  Anyways, attached is the RecordDataB.mxml file.

Thanks,

Jesse

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Jesse,

   It is hard to just jump into someones code and diagnose the issue. I think I need the com.esri.viewer.components.HeaderRenderer too.

0 Kudos
JesseHopkins
Regular Contributor

Robert,

I understand completely.  If anything, I'm happy to know that there isn't a glaring error from a stupid mistake!  I just went ahead and attached the src folder minus images/assets.  Again, I appreciate you taking a look at this.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Jesse,

   Have you done this work or are you just taking over?

Have you run the app in debug mode and put a break point in the zoomToFeature function to see if it ever gets called and if it does does the event.data.widget exist?

JesseHopkins
Regular Contributor

Robert,

Most of this work was done by Larry Stout, but me and my predecessor have done a decent amount of customization on the widgets. 

I'm unsure on what the previous version of this Date Search widget was, but I had to make a few changes to get it working with our current version of the Flex API - 2.3.1.  I'm aware that this outdated, however I am working on a JS site, and have not been granted privileges to upgrade the Flex app.

Unfortunately I have not run the app in debugger mode, there are always a whole host of issues when trying to run it. I'll try to get this working.

Thanks,

Jesse

0 Kudos