Defining a custom component with a string property in an external .ux file causes ‘ClassName’ does not have a property called ‘PropertyName’, when using that component in MainView.ux.
I’m using version 0.11 and I’m having the same problem: When I define a custom class with a Property in an external ux file I get the “E8001: ‘%s1’ does not have a property called ‘%s2’” error. If I keep the custom class definition on the same file that uses it I don’t get an error.
Thanks for the reply. I think I’ve figured out the problematic case in my usage:
There is no problem when I create a single custom component in a separate file.
The problem appears when I define my multiple custom classes in a single file under <Panel> tag (By the way keeping custom components under <Panel> tag is something that I’ve read in one of the forum threads).
I’ve easily reproduced it by tweaking the new Fuse project sample: I’ve moved the PageWithTitle custom class to another file named common.ux, inside a <Panel> tag and I got the error:
E8001: 'PageWithTitle' does not have a property called 'HeaderColor'
Hope this gets fixed soon because we need one place to keep all these UI components. We don’t want these definitions to clutter our working logic inside pages but also don’t want to keep them in different files.
As you said yourself earlier, everything works if you just have one custom class in the file. In other words: if you just remove the outer panel in the common.ux it’ll work for the example you uploaded
As far as I understood the real problem is that you’d like to have multiple custom classes defined in the same .ux file? In that case you can simply write them all inside the same class.
So in other words:
If you just want one custom class in the .ux file:
<Page ux:Class="PageWithTitle">
....
If you want more than one custom class defined in the same file (and accessed from somewhere else) you need to bundle them up:
As a separate (but related) point: if your custom classes should have access to anything in its parent scope then you have to look into ux:include and ux:innerclass. But I think the above should be the solution for your current question.