[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Pass value from outer mxml to inner mxml

Posted on 2011-03-22
5
Medium Priority
?
523 Views
Last Modified: 2012-05-11
hi guys i have main.xml and summaryView.mxml. Iam trying to pass value from the main.xml into summaryView.mxml

main.mxml
<mx:VBox>
<mx:Script >
<![CDATA[
 import org.entity.project.ProjectSummaryDTO;	
[Bindable]
public var currentProject:ProjectSummaryDTO;

</mx:Script>
<mx:Form width="1094" height="2200">	
<mx:ViewStack id="workflowViewStack" width="100%" height="100%" borderColor="#000000" cornerRadius="4" >
<projectWork:summaryView label="Project Info"/>      --  The inner mxml,not able to pass id here
<projectWork:detailView label="{currentProject.id}"/>  -- This works fine, i am able to see the id.			 
</mx:ViewStack>			
</mx:Form>	
</mx:VBox>

Open in new window


and this is my summaryView.mxml which is my inner mxml

<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" 
 xmlns:projectNav="org.view.projectNav.*" creationComplete="init()"
width="100%" height="100%">
	 
<mx:Script>
<![CDATA[
import org.entity.project.ProjectSummaryDTO;	
import mx.controls.Alert;			 
[Bindable]
public var currentProject:ProjectSummaryDTO;
public function init():void {		
Alert.show(currentProject.id, "passing workflow id"); -- This does not work, i dont see the id here 			
}
]]>
</mx:Script>

Open in new window


I am trying to pass the value of currentProject.id   from a outer mxml (main.mxml)  to a inner mxml (summaryView.mxml) .
any idea how i can get the value of currentProject.id  in my summaryView.mxml?

any help appreciated
thanks
0
Comment
Question by:royjayd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 29

Expert Comment

by:dgofman
ID: 35192345
I cannot see your are using summaryView.mxml in your main.mxml
0
 
LVL 29

Accepted Solution

by:
dgofman earned 2000 total points
ID: 35192675
Alert.show(currentProject.id, "passing workflow id"); -- This does not work, i dont see the id here                   
-- You cannot see id because you currentProject is NULL

<projectWork:summaryView label="Project Info"/>      --  The inner mxml,not able to pass id here

-- You are not passing "currentProject", how inner class should get your instance?

Here is the solution:

<projectWork:summaryView label="Project Info" currentProject="{currentProject}"/>  
0
 

Author Comment

by:royjayd
ID: 35194374
thx very much that worked.
0
 

Author Comment

by:royjayd
ID: 35194399
0
 
LVL 29

Expert Comment

by:dgofman
ID: 35194419
Yes, I will look
0

Featured Post

[Video] Create a Disruption-Free Workspace

Open offices have their challenges. And Sometimes, it's even hard to work at work. It's time to reclaim your office and create a disruption-free workspace. With the MB 660, you can:

-Increase Concentration
-Improve well-being
-Boost Productivity

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question