4 Replies Latest reply on Jun 20, 2007 7:01 AM by savyasachi

    Flexstore sample

    savyasachi
      Trying to mimic the Flexstore application to understand how the page navigation works with Flex 2. Added a login functionality to the Flexstore app and moved the ViewStack to a new state "LoggedIn State" and switching to this state after a successful login. All is working good and I can switch between the Views. However, I am not seeing the Icons/Thumbnails in the Product Catalog Panel. I debugged the code and all the products are getting loaded into the arrays and I can see the products data in the variables and I even see a vertical scrollbar indicating there are thumbnails on Product Catalog panel, but not seeing the pictures or the associated text. Has anyone run into this issue.

      Appreciate if you can help me with this. Struggling with this for the past few days and any help will be greatly appreciated.
        • 1. Re: Flexstore sample
          Level 7
          I've got the login process working without loosing the images but I'm having
          a hard time getting a registration process sorted. Have you managed to get
          that part working as well?? I'd love to swap samples with you but I'm not
          sure what the adobe EULA says about that. I actually asked for a copy of it
          without response.

          Bill


          "savyasachi" <webforumsuser@macromedia.com> wrote in message
          news:f5a0s7$a8s$1@forums.macromedia.com...
          > Trying to mimic the Flexstore application to understand how the page
          > navigation
          > works with Flex 2. Added a login functionality to the Flexstore app and
          > moved
          > the ViewStack to a new state "LoggedIn State" and switching to this state
          > after
          > a successful login. All is working good and I can switch between the
          > Views.
          > However, I am not seeing the Icons/Thumbnails in the Product Catalog
          > Panel. I
          > debugged the code and all the products are getting loaded into the arrays
          > and I
          > can see the products data in the variables and I even see a vertical
          > scrollbar
          > indicating there are thumbnails on Product Catalog panel, but not seeing
          > the
          > pictures or the associated text. Has anyone run into this issue.
          >
          > Appreciate if you can help me with this. Struggling with this for the past
          > few
          > days and any help will be greatly appreciated.
          >


          • 2. Re: Flexstore sample
            savyasachi Level 1
            Yes, I have the registration piece working. This is how I am doing it. I have added a "Please register" link button to the base state screen. When the user clicks this screen, I am taking the user to another state "Registration" where the user completes the registration form. After a successful registration, I am taking him back to the base state where he need to login...etc to get to the "logged in" state where he/she will see the ViewStack. What are the difficulties you are facing with the registration. Please let me know if this helps.
            How did you implement your login function?
            • 3. Re: Flexstore sample
              Level 7
              On the ProductCart file I include the form I created

              <mx:Button label="{checkoutButtonLabel}" click="callRemoteMethod()"/>

              <forms:LoginForm id="loginForm"
              visible="false"
              showEffect="WipeDown"
              hideEffect="WipeUp"
              login="cfService.loginUser(event.loginObject.username,
              event.loginObject.password)"/>

              and the script code for this is

              import dto.User;
              import mx.rpc.events.ResultEvent;

              [Bindable]
              private var currentUser:User = new User();

              [Bindable]
              private var checkoutButtonLabel:String = "Proceed to Checkout";

              private var currentFunction:Function;

              private function callRemoteMethod():void
              {
              if (currentUser.loggedIn)
              {
              cfService.loginSuccess();
              checkoutButtonLabel = "Process Order";
              }
              else
              {
              loginForm.visible = true;
              currentFunction = callRemoteMethod;
              }
              }

              private function loginResultHandler(event:ResultEvent):void
              {
              currentUser = event.result as User;
              if (currentUser.loggedIn)
              {
              loginForm.visible=false;
              currentFunction.call();
              }
              else
              {
              Alert.show("login unsuccessful", "Server Authentication");
              }
              }


              Contact me offlist and I'll get you the files I created. info at datapacks
              dot com


              "savyasachi" <webforumsuser@macromedia.com> wrote in message
              news:f5a4dv$e22$1@forums.macromedia.com...
              > Yes, I have the registration piece working. This is how I am doing it. I
              > have
              > added a "Please register" link button to the base state screen. When the
              > user
              > clicks this screen, I am taking the user to another state "Registration"
              > where
              > the user completes the registration form. After a successful registration,
              > I am
              > taking him back to the base state where he need to login...etc to get to
              > the
              > "logged in" state where he/she will see the ViewStack. What are the
              > difficulties you are facing with the registration. Please let me know if
              > this
              > helps.
              > How did you implement your login function?
              >


              • 4. Re: Flexstore sample
                savyasachi Level 1
                Thanks Bill.

                I am able to see the thumbnails of the products, when I moved the viewstack out of the state they were in. I created a new Application file for testing sake and moved the ApplicationControlBar and the corresponding ViewStack code to this new page. When I ran it vaala, I can see the product thumbnails and the labels...etc. Don't know if this is a bug or limitation of Flex 2.

                I would like to make users to login to my site to see the products. Hence I am keeping the viewstack inside a "loggedin 'state' ". Have you tried this before? If this is a Flex limitation, I may have to follow your appoach only.

                I will contact you offline for the source files.