Link to home
Start Free TrialLog in
Avatar of srujanmiryala
srujanmiryalaFlag for India

asked on

Flex Repeater

Hello every one,
please use cairngorm.swc file

my question is.
select the number of passengers and when you click on submit button i am going to show the data like passenger DateofBirth field and age feild in the second page.

when i change the date feild to the passenger date of birth i need to populate the age feild with the age of passenger (this should be calculated according to the date selected in date feild) and that should show in years(like if age is one year and two months it should show as 1.2)

and when i click the submit button in second page i need to check whether all the feilds are entered in the repeater.

can anybody help me in this.

Thanks in advance

RepTest.txt
first.txt
second.txt
last.txt
AppModelLocator.txt
Avatar of zzynx
zzynx
Flag of Belgium image

>> if age is one year and two months it should show as 1.2
???
one year and 1 month = 1.1
one year and 10 months = 1.10 also?

Since 2 months = 2/12 or 1/6 or 0.16666 year shouldn't that be 1.1666666?
Avatar of srujanmiryala

ASKER

Hello ZZynx,
Sorry for the late reply.i was waiting for the confirmation how the age should be displayed.
it should be disaplayed in months(i.e one year and 1 month = 13).
In second.mxml there's

    for(var i:int=0;i<modellocator.numberofPassengers;i++) {

while numberofPassengers is undefined in AppModelLocator.
Same for

     passinfArrayColl

and

     LAST
package
{
      import com.adobe.cairngorm.model.IModelLocator;
      
      import mx.collections.ArrayCollection;
            
      [Bindable]
      public class AppModelLocator implements IModelLocator
      {
            public static var instance:AppModelLocator;
            public function AppModelLocator(enforcer:SingletonEnforcer)
            {
                  if (enforcer == null)
                  {
                        throw new Error("You can only have one modal locator");
                  }
            }
            public static function getinstance():AppModelLocator
            {
                  if (instance == null)
                  {
                        instance = new AppModelLocator(new SingletonEnforcer);
                  }
                  
                  return instance;
            }
            
            // Define Variablea
            public var workflowState:uint = 0;
            
            // Number of passengers
                                          public var numberofPassengers:int;
            public var passinfArrayColl:ArrayCollection;
            
                        
            // Define Constants
            public static const FIRST:uint = 0;
            public static const SECOND:uint = 1;
            public static const LAST:uint = 2;
            

      }
}
class SingletonEnforcer{}
hey zzynx:

Did you find any solution for this i have kept the model locator code in previous comment
ASKER CERTIFIED SOLUTION
Avatar of zzynx
zzynx
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hey You are Excellent
Thank you very much.
Onemore Question after clicking the proceed button and before navigating to last page i need to check whether all the feild in the repeater are entered or not. how to do this.
thanx 4 axxepting

>> Onemore Question after clicking the proceed button and before navigating to last page i need to check whether all the feild in the repeater are entered or not. how to do this.
http://livedocs.adobe.com/flex/3/html/help.html?content=validators_2.html
http://blog.flexexamples.com/2007/08/13/validating-flex-forms-using-the-validator-classes/