3 Replies Latest reply on Feb 4, 2008 10:46 AM by Tikis_Mikis

    Flex forms tutorials

    Tikis_Mikis Level 1
      Hello I am attempting to develop an application that behaves like a "wizzard". In other words my "form" will be several stages (steps) long. So that means that once a user comes in to my page a form is shown with the initial input fields to be entered by the user. The user clicks "next". The data is stored somehow and step 2 form comes up with more fields. There are two buttons here one for "back" and one for "next".

      "back will return the user to the first step form with the data that was entered appearing in the text fields. Going back to step 2, "next" will store all data from step 2 form and go on to step 3. Again, step 3 form will contain two buttons, "back" and "next" that will behave just like the ones in step 2 form.

      At the end of steps the final button appears "save" or "submit". this stores the information in a DB.

      Does anyone know of any good sources online to create this type of application? I am googling but only find single form or even a form where a pop up form comes up but thats not what I want.

      Any help is greatly appreciated.

      Oh and this time I will only post here ;-)
        • 1. Re: Flex forms tutorials
          Tikis_Mikis Level 1
          Has anyone ever done this? I would have thought that something like this would be something common in flex. I really need help please and thank you! Any pointers are greatly appreciated.
          • 2. Re: Flex forms tutorials
            Ratsnackbar Level 2
            I believe what you are going to want to do is to implement a Command Patter. It's really not to hard to do once you understand the pattern and how it works.

            Here, check this out:

            The short version of how you would do it is this.
            Create a ValueObject that has all the field variables you want in it with getters and setters. (Or bind to it if you wish.)

            In the same VO or in another class that is aware of the VO create functions for such things as transferring your data, rolling back your data and validation before you send it off.

            If the data does not validate you can trigger events that the form listens for to prompt the user.

            When you instantiate your form also instantiate the ValueObject. Hint: the singelton pattern works best for the VO in most cases.

            Then as the user fills in fields populate the fields in your VO.

            Once the user reaches the last page and clicks submit you would then have that button trigger the function to send off your data.

            Hope that helps.

            PS. Replace the word function with the word Method above. Sorry about that I am a CFer. Still trying to get used to you Flexers Lingo. :D
            • 3. Re: Flex forms tutorials
              Tikis_Mikis Level 1
              Hm ok! Don't worry i'm PHPer and C++er so I just function not method!