12 Replies Latest reply on Jan 25, 2012 4:19 PM by Flex harUI

    Help needed "tabEnabling" not working in simple login page - Flex

    Rajeshb_Flash Level 1

      Hello Friends,

       

      I need a small help in Flex. I am doing a simple login page application  in FlashBuilder 4.0 & i have kept 2 input boxes like Login,Password  and a submit buttion. On clicking the button i am calling a method, so  far everything is working fine.... But some how tabenabling is not  working. suppose if you are in login inputbox and i press "tab key" it  has to go to password input box.. but its not working. can any one help  me on this, why it is not working. i have tried all the attempts using  tabEnabled = "true". but stil i am failing to do this.

       

      your help would be appreciated.

       

       

      Rajesh

       

      Message was edited by: Rajeshb_Flash

        • 1. Re: Help needed "tabEnabling" not working in simple login page - Flex
          saisri2k2 Level 4

          Please post the code.

           

          There is something called TabIndex on all the elements. May be you can try that.

          • 2. Re: Help needed "tabEnabling" not working in simple login page - Flex
            Flex harUI Adobe Employee

            Flex 4 does not use tabEnabled, it uses tabFocusEnabled.  Another important

            thing is that the popup container must implement IFocusManagerContainer, so

            don't start with a Group.

            • 3. Re: Help needed "tabEnabling" not working in simple login page - Flex
              Rajeshb_Flash Level 1

              Hello Flex harUI,

               

              Thanks for your reply. i have  tried all possible ways to make it work, but still i am helpless.... can  you pls help me out from this.

               

              please give me a solution for this

               

              Rajesh

              • 4. Re: Help needed "tabEnabling" not working in simple login page - Flex
                Flex harUI Adobe Employee

                Post a 20-line test case showing the problem.

                • 5. Re: Help needed "tabEnabling" not working in simple login page - Flex
                  Rajeshb_Flash Level 1

                  <?xml version="1.0" encoding="utf-8"?>

                  <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
                     width="100%"
                     height="100%"
                     verticalAlign="middle"
                     horizontalAlign="center">

                  <mx:Script>
                    <![CDATA[
                    
                     import com.tel.model.EventConstants;
                    
                     import mx.controls.Alert;
                     import mx.managers.CursorManager;
                     import mx.rpc.events.FaultEvent;
                     import mx.rpc.events.ResultEvent;
                     import mx.rpc.http.mxml.HTTPService;
                    
                     private var httpService:HTTPService;
                     public var userID:String = "";
                    
                     public function init():void{
                     
                     }
                    
                     private function mouseClickSubmit():void{
                      if(userName.text != "" && password.text != ""){
                      
                       userID = userName.text;
                       initService();
                      }else{
                       if(userName.text == ""){
                        Alert.show("Please enter 'User Name'.","Alert!")
                       }else if(password.text == ""){
                        Alert.show("Please enter 'Password'.","Alert!")
                       }
                      }    
                     }
                    
                     private function initService():void{
                      var params:Object = new Object();
                      params["userName"] = userName.text;
                      params["password"] = password.text;
                     
                      httpService = new HTTPService();
                      httpService.showBusyCursor = true;
                      httpService.resultFormat = "xml";
                      httpService.method=URLRequestMethod.POST;
                      httpService.addEventListener(ResultEvent.RESULT, httpServiceResultHandler);
                      httpService.addEventListener(FaultEvent.FAULT, httpServiceFaultHandler);
                      httpService.url = "Login.action";
                      httpService.send(params);
                     }
                     private var boolFirstRun = true;
                     private function httpServiceResultHandler(event:ResultEvent):void{
                      httpService.removeEventListener(ResultEvent.RESULT, httpServiceResultHandler);
                      httpService.removeEventListener(FaultEvent.FAULT, httpServiceFaultHandler);
                      httpService = null;
                      var resultXML:XML = new XML(event.result.toString());
                      if(resultXML.children().toString() == "true"){
                      
                       boolFirstRun = false;
                       dispatchEvent(new Event(EventConstants.LOGIN_SUCCESS))
                      }else{
                       userName.text = "";
                       password.text = "";
                       Alert.show("Login Failed! Invalid 'User Name' or 'Password'.","Alert")
                      
                      }
                     }
                    
                     private function httpServiceFaultHandler(event:FaultEvent):void{
                     
                      httpService.removeEventListener(ResultEvent.RESULT, httpServiceResultHandler);
                      httpService.removeEventListener(FaultEvent.FAULT, httpServiceFaultHandler);
                      httpService = null;
                     }
                    
                    ]]>
                  </mx:Script>
                  <mx:Panel title="Login Page" width="400" height="300" styleName="loginPanel" verticalAlign="middle" horizontalAlign="center" backgroundImage="assets/images/hello.jpg" backgroundAlpha=".1">
                     <mx:VBox width="260" height="95" styleName="loginBox" backgroundAlpha=".2">
                     <mx:HBox width="100%">
                      <mx:Label width="85" text="User Name" styleName="loginTextStyle"/>
                      <mx:TextInput width="150" id="userName"/>
                     </mx:HBox>
                     <mx:HBox width="100%">
                      <mx:Label width="85" text="Password" styleName="loginTextStyle"/>
                      <mx:TextInput width="150" id="password" displayAsPassword="true"/>
                     </mx:HBox>
                     <mx:HBox width="100%">
                      <mx:Spacer width="80%"/>
                      <mx:Button label="Enter" id="submit" click="mouseClickSubmit()"/>
                     </mx:HBox>
                    </mx:VBox>
                  </mx:Panel>
                  </mx:VBox>

                  • 6. Re: Help needed "tabEnabling" not working in simple login page - Flex
                    Rajeshb_Flash Level 1

                    NOTE :

                     

                    Line #      dispatchEvent(new Event(EventConstants.LOGIN_SUCCESS)) where ever you find this line in my code, pls use the below line ie 

                    public static var LOGIN_SUCCESS:String = "LoginSuccess";

                     

                     

                    waiting for your reply.

                     


                    • 7. Re: Help needed "tabEnabling" not working in simple login page - Flex
                      Flex harUI Adobe Employee

                      That is more than 20 lines, and is not a complete test case.

                      • 8. Re: Help needed "tabEnabling" not working in simple login page - Flex
                        Rajeshb_Flash Level 1

                        Hello Flex harUI,

                         

                        I dint get you what you are looking for ?? Anyways i have shared all the code what i am doing and i told you precisely what the problem i am facing.  I think you can easily figure it out from my code ie my problem !!!

                         

                        Test case is nothing but,

                         

                        Login : Some Input Box      (user entered some text) + if you press TAB key its not going to Password inputbox ?? why ?? whats the mistake ?

                        Password: Some input box  (same thing happenind here also ) why ?? tabbing not working ?


                        Submit button

                         

                        I have tried using, tabIndex, tabEnabled etc.

                         

                        Waiting for your reply. I hope you got it now.

                        Rajesh

                        • 9. Re: Help needed "tabEnabling" not working in simple login page - Flex
                          Flex harUI Adobe Employee

                          I need to cut and paste and compile a test case.  I don't have time to

                          create one for you.  And by fitting it in 20 lines, I am forcing you to

                          simplify the test case to reduce chance that it is a silly error.

                           

                          Post a 20-line test case.

                          • 10. Re: Help needed "tabEnabling" not working in simple login page - Flex
                            rtalton Level 4

                            You need to post a complete test case. This looks like a component based on a VBox, so we cannot know how you are using it. If it is used as a pop-up, there are other factors which could could be affecting the application's focus and take it away from the component.

                             

                            I can tell you that if you only used this VBox on its own (not in a pop-up) it will work fine. Try it.

                            • 11. Re: Help needed "tabEnabling" not working in simple login page - Flex
                              jetrased

                              Hi

                               

                              I am having a similar problem, I have a Login form that pops up. The issue is that when you first try to tab between the input boxes and the button the first time it loads then it is not allowed. I can see the tab working behind the popup.

                               

                              However if you try and login and fail, then tab becomes enabled. So it looks like a focus issue. Any ideas why this would be? The way it is setup is that the application is created and oncomplete it calls the login popup. I have no idea how I can get the focus on the login after it is created.

                              • 12. Re: Help needed "tabEnabling" not working in simple login page - Flex
                                Flex harUI Adobe Employee

                                Does the login popup setFocus to a control?

                                 

                                Alex Harui

                                Flex SDK Developer

                                Adobe Systems Inc.<http://www.adobe.com/>

                                Blog: http://blogs.adobe.com/aharui