PDA

View Full Version : Navigate from one MXML Page to another


Poseidon
08-07-2008, 12:56 PM
hi,

I need to navigate from one MXML(Page1.mxml) to another MXML(Page2.mxml) on a button click, but i have to do it without using "ViewStack" or Hyperlinks. Is there any other Alternative other than the one i have specified. Its kind of urgent please do help me :(

corbo950
08-07-2008, 05:02 PM
ok there is no such thing as pages in flex just views so y cant u use a view stack? code would help

Stealth86
08-07-2008, 05:20 PM
hi,

I need to navigate from one MXML(Page1.mxml) to another MXML(Page2.mxml) on a button click, but i have to do it without using "ViewStack" or Hyperlinks. Is there any other Alternative other than the one i have specified. Its kind of urgent please do help me :(

Is this homework? Because these seem like some very artificial constraints.

Poseidon
08-08-2008, 05:21 AM
Navigating from one mxml to another
----------------------------------

I was navigating from "ListPage " to "ViewBasePage" using the
below code if the two components are in the same ViewStack ("applicationViewStack")

var basePage:BasePage;
basePage = BasePage(this.parentDocument);
basePage.applicationViewStack.selectedIndex =1;
-------------------------------------------------------------------

But how do i implement if i need to Navigate from "SearchLandingPage" that is in "BasePage.mxml" (The Parentdocument is different)
to "EnrollmentForm" which in EmployeePage.mxml

BasePage.mxml
-------------

<mx:ViewStack id="applicationViewStack"
width="100%" height="100%">
<home:Home id="applicationHome" label="Home" width="100%" height="100%"/>
<Land:ListPage id="raListPage" label="Region Approval" width="100%" height="100%"/>
<view:ViewBasePage id="viewPage" label="FACOMP" width="100%" height="100%"/>-->
<search:SearchLandingPage id="searchBasePage" label="Search" width="100%" height="100%"/>
</mx:ViewStack>


EmploeePage.mxml
----------------

<mx:ViewStack id="tcBaseViewStack" width="100%" height="100%" >
<view:EmployeePage id="empLandingPage" width="100%" height="100%"/>
<view:EnrollmentForm id="Form" width="100%" height="100%"/>
<search:SearchLandingPage id="Search" width="100%" height="100%"/>
</mx:ViewStack>

corbo950
08-08-2008, 10:16 AM
if what your trying to do is referance back to the viewstack inside of one of the componets then this is what u want:

mx.core.Appliction.appliction.tcBaseViewStack = (what ever index you want)

also forget about pages there is no such thing it flex or flash just viewstates

Poseidon
08-13-2008, 12:54 PM
if what your trying to do is referance back to the viewstack inside of one of the componets then this is what u want:

mx.core.Appliction.appliction.tcBaseViewStack = (what ever index you want)

also forget about pages there is no such thing it flex or flash just viewstates
hi Corbo,

Your suggestion was very helpful and i have a requirement in which i have a parent document (mxml) and this parent window has child compenents (pop-ups) and when i close the pop-ups i need to reload the parent page ..

To make it simpler i need to reload the Parent page (Like refreshing the page) as the pop-ups which i create from the parent page will change the data (in DB) that the Parent document uses in its Datagrid.

Any Sugesstions ???

corbo950
08-13-2008, 06:12 PM
all that you have to do is reload the new data. How ever you got it in the first place just do that again