1

What I have in my Component.js are these routes:

routes: [
                {
                    pattern: "",
                    name: "menu",
                    view: "Menu",
                    targetAggregation: "pages",
                    targetControl: "idAppControl",
                    subroutes: [
                        {
                            pattern: "Reports",
                            name: "reports",
                            view: "SplitContainer",
                            targetAggregation: "pages",
                            targetControl: "idAppControl",
                            clearTarget: true
                        }
                    ]
                }
            ]

When I try to access the subroute (URL/#/Reports) the application throws (Chrome):

Control idAppControl does not has an aggregation called pages -

This is confusing due to the fact, that "idAppControl" is an App and therefor HAS an aggregation pages. Also, the first "main" route works pretty well, even though I'm using exactly the same control (and aggregation) as in the subroute.

What could be wrong?

OddDev
  • 3,644
  • 5
  • 30
  • 53
  • You need not have targetControl in the subroute – c_y Mar 16 '15 at 14:07
  • @stpc Thanks for your reply. I've configured a targetControl in the subroute. The fifth line in the subroute properties. subroutes: [ { pattern: "Reports", name: "reports", view: "SplitContainer", targetAggregation: "pages", targetControl: "idAppControl", clearTarget: true } ] – OddDev Mar 16 '15 at 14:19

1 Answers1

1

I've found out what's wrong. It's kinda a "scope" problem. You can't join the same control as your parent route has. You can produce the following error message with the same problem:

Control with ID idAppControl could not be found

What I've done is:

         routes: [
            {
                pattern: "",
                name: "menu",
                view: "Menu",
                targetAggregation: "pages",
                targetControl: "idAppControl"
            },
            {
                pattern: "Reports",
                name: "reports",
                view: "SplitContainer",
                targetAggregation: "pages",
                targetControl: "idAppControl",
                clearTarget: true
            }
        ]

In retrospect this seems to be quite logical :D

OddDev
  • 3,644
  • 5
  • 30
  • 53