0 Replies Latest reply on Aug 1, 2012 11:29 AM by lee704

    Loop through a model to get variables and values

    lee704 Level 1

      I use an AS model (named AppGlobals.as) to store the application variables. I need to replace the hard-coded values of the elements to ones pulled from a database. As such, I need to iterate through the model to find all the elements that match my query results and then set the value of the elements to those returned from the database query.


      My current issue is that I have no clue how to iterate through the model to get the elements so that I can use them a parameters for my query. An example of AppGlobals.as follows...


      package com.models



                public class AppGlobal


                          public var appAnnualMaintenanceAlert:String="The System is unavailable due to routine annual maintenance!  Please check back after 2:00 PM Eastern on  January 1, 2012!";

                          public var appAnnualMaintenanceStart:Date=new Date(2012, 11, 31, 18, 0, 0, 0);

                          public var appAnnualMaintenanceEnd:Date=new Date(2013, 0, 1, 14, 0, 0, 0);

                          public var appYearPrevious:String="2011";

                          public var appYear:String="2012";

                          public var appYearNext:String="2013";

                          public var dttm_landing_expected:String="1/1/2012 12:00:00 AM";






      How can I iterate through the model to find all the var names and then match them with my query to return the corresponding values?  Any help is appreciated.