Skip to Content

getrouter( ) and init( ) event

Jan 25 at 07:00 PM


avatar image

Hi experts,

It doesn't seem to be a problem but rather a general understanding and maybe a best-practice question.

Here's the deal: in the Component.js of my UI5 application there are 2 calls:

UIComponent.prototype.init.apply(this, arguments);

As I can see in the debugger - each call will invoke init( ) event of my main view (configured in manifest.json). Suppose I have onPatternMatched function and I am adding a control with ID parameter. What happens in this case is - an engine throws an error by saying - you are trying to add a control with an ID that already exists. This is just because both calls from Component.js do call init( ) of a view.

So what would be the best way to avoid such an issue? I assume you can do data bindings and etc. actions that require named elements on the main view?



10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers