开发者

Opening a new tab and adding an mxml component to it

Hi In our flex application we have tabs at the main level and under it we have subview.

e.g Home / Tasks / Admin etc...

In one condition we have to click on a button and open a new tab, on this tab we have to add an existing mxml component and show it in the tab. We are using parsley as the framework.

Inside the mxml component test.mxml (that is shown in the tab) i am configuring it with parsley using the tag

Now when i add the instance of this test.mxml i am getting an exception

开发者_运维问答I am deriving this test.mxml instance using teh parsley context

as

context.getObject(id of component) as DisplayObject and adding it to the tabNavigator...

But i am getting exception when i try to grab an instance of a view using parsley context.

How do i get an instance of a view or component that is configure through parsley using the parslye context.

posting some code

in parsley context mxml file

in mediator class

public class TestMediator {

[Inject(id="testViewID")] public var testView:TestView;

and then i add this view object to a container....

Also the problem is occuring becuase of the view injection..because i get a parsley excepiton on startup of the application stating that there is some problem in the context.


What exception are you getting? Without this information it's hard to help you out.

Anyways, here are some thoughts:

  • creating views through the container should not be a problem
  • note that MXML components can't take constructor arguments, so make sure you don't have any in your object definition
  • children of the tab navigator should be containers, not just display objects
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜