Module: nagvis
Branch: master
Commit: dce0535b5b0e9a37d73b46b9acec5110dde99f48
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis/commit/?id=dce0535b5b0e9a37d73b46b9acec5110dde99f48

Author: Andriy Skuratov <[email protected]>
Date:   Tue Aug 25 13:55:43 2009 +0300

gmap:Search address if user pressed enter key.

---

 uifx/src/modules/gmap/view/DialogSearch.mxml |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/uifx/src/modules/gmap/view/DialogSearch.mxml 
b/uifx/src/modules/gmap/view/DialogSearch.mxml
index 5feac66..bee495d 100644
--- a/uifx/src/modules/gmap/view/DialogSearch.mxml
+++ b/uifx/src/modules/gmap/view/DialogSearch.mxml
@@ -27,11 +27,18 @@
        <![CDATA[
                import modules.gmap.events.AddressEvent;
                
-               public function onLocateClicked():void
+               public function locateAddress():void
                {
+                       address.text = address.text.replace(/\s+/g, ' ');
                        if(address.text.length > 0)
                                dispatchEvent(new 
AddressEvent(AddressEvent.LOCATE, address.text))
                }
+
+               public function 
onAddressFieldKeyPressed(event:KeyboardEvent):void
+               {
+                       if(event.keyCode == Keyboard.ENTER)
+                               locateAddress();
+               }
        ]]>
     </mx:Script>
        <mx:HBox left="10" right="15" top="10" height="20">
@@ -47,10 +54,11 @@
                <flexlib:PromptingTextArea id="address"
                        left="0" right="0" top="0" bottom="30"
                        cornerRadius="4" prompt="Address"
+                       keyUp="onAddressFieldKeyPressed(event)"
                 />
                <mx:Button label="Locate"
                        right="0" bottom="0" height="22"
-                       click="onLocateClicked()"
+                       click="locateAddress()"
                />
        </mx:Canvas>
 </EdgeBox>


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to