tags:

views:

44

answers:

0

Hi, In the following XML, I can display controls (textfield,buttons,labels) dynamically on view according to XML tags... I am using NSXMLParser..

The XML is like this.....

< page template="Login" pageIndex="1" pagetype ="Start"> < title>Sub Header < subtitle>Sub Header

    < content rowcount ="2">

  < row index="1">
           < Ctl type="Label" name="lblLogin"> 
             < loc pos="Left">
             < /loc>                
             < text>User Name</text>            
         < /Ctl>

     < Ctl type="TextBox" name ="txtLogin">
          < loc pos="Right">
                    < /loc>
          <Text></Text>                    
        < /Ctl>
     < /row>



  < row index="2">
    < Ctl type="Label" name="lblPassword"> 
        < loc pos="Left">
        </loc>                
        < text>Password< /text>            
   < /Ctl>

< Ctl type="TextBox" name ="txtPassword">
        < loc pos="Right">
        < /loc>
        < Text></Text>                       
    < /Ctl>

 < /row>

< /content>

////// Two butttons : LOGIN and EXIT for login < menu> < menuItem text="Login" url="http://xxxxxxxx" Operation="LOGIN">
< /menuItem> < menuItem text="Exit" Operation ="APP_EXIT"/>
< /menu>

 < Opeartion id="LOGIN">
     < OnSucess goToPage="2" Message=""/>
    < OnFailure goToPage ="1" Message="Autehtication Faliure! The enterd user
     name or password is not correct."/>         
 < /Opeartion>

  < Opeartion id="APP_EXIT">
     < Action>Logout< /Action>         
 < /Opeartion>

< /page>

//////// New Page for FAQ /////// First 4 questions on page 2

< page template="FAQ" pageIndex="2"> < title > Header < /title> < subtitle>Sub Header < /subtitle>

< content rowcount ="4">
< row index ="1"> < Ctl type="Label" id="FAQ2_Q1" name="lblQuestion1"> < /loc>
< text> 1.Location of program< /text>
< /Ctl>
< /row>

  < row index ="2">
      < Ctl type="Label" id="FAQ2_A1" name="lblAwnser1"> 
        <loc></loc>             
        < text>India< /text>            
       </Ctl>
  </row>

  <row index ="3">
       < Ctl type="Label" id="FAQ2_Q3" name="lblQuestion3"> 
        <loc></loc>             
        < text>2. What is the selection process< /text>            
       </Ctl>             
  </row>

  < row index ="4">
      < Ctl type="Label" id="FAQ2_A2" name="lblAwnser2"> 
        <loc></loc>             
        < text>Aptitude Test</text>            
       < /Ctl>
  </row>
</content>

////// Button to go to next page(page no.3) and LogOff

 < menu>      
  < menuItem text="Next" Operation="Next"/>
  < menuItem text="Log Off"   Operation ="APP_EXIT"/>
< /menu>   
< Operation id="Next">        
    < Action goToPage="3"></Action>
< /Operation>
 < Operation id="APP_EXIT">        
    < Action>Logout</Action>
< /Operation>

< /page>

I can display Username,Password labels by creating them dynamically using self.view

But After Authentication To display FAQ page,I need to load another view (Or clear current view...) How to generate Labels on next view ? As I cant use self.view

It may be something easy...But I am new to iPhone.. Thanx in advance..