ux:Property in external file

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.

Ex. component (Indicator.ux):

<Panel ux:Class="Indicator" ux:Name="self" Width="30">
    <string ux:Property="Text" ux:Value="" />
    <Text Alignment="Center" Value="{Property self.Text}"/>
</Panel>

MainView.ux:

<App Theme="Basic" Background="#a2d6eb">

    <DockPanel Padding="8">
        <StatusBarBackground Dock="Top" />

        <Panel>
            <Indicator X="36%" Y="45%" Text="1" />
            <Indicator X="51%" Y="48%" Text="2" />
            <Indicator X="67%" Y="43%" Text="3" />
            <Indicator X="53%" Y="30%" Text="4" />
            <Indicator X="62%" Y="37%" Text="5" />
        </Panel>
    </DockPanel>
</App>

Hi,

This bug, and many other bugs, have been fixed internally but not rolled out yet.

Have a look here: https://www.fusetools.com/community/forums/permalink/2d6bfc0d-8829-4531-a63f-6e5985d89a1c

I expect this to roll out in 0.9.6

Hi,

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.

Has the fix been applied to this revision?

Thanks in advance

Hi ipek:

This was fixed a long time ago. If you still have an issue, we’ll need a complete test case that reproduces the problem to help you.

Thanks

Hi Anders,

Thanks for the reply. I think I’ve figured out the problematic case in my usage:

  1. There is no problem when I create a single custom component in a separate file.
  2. 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.

Thanks in advance

Hi,

Is there any update on this issue?

Thanks

As Anders already requested: please provide a complete example that reproduces the issue. This makes it a lot easier for us to help you out.

You can either include the code in a forum post (if it’s short) or upload it to: https://www.dropbox.com/request/ZgndLtJQm5eGzG9cicGK

Thanks for the reply Remi. I’ve uploaded the sample project zip file to Dropbox with the name propertyUsageFromExternalFile.zip.

As I’ve said previously I get the following error during build:

E8001: 'PageWithTitle' does not have a property called 'HeaderColor'

And I’m using the latest Fuse with version 0.12.1

Ipek

Thanks for the upload!

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:

  1. If you just want one custom class in the .ux file:
 <Page ux:Class="PageWithTitle">
 ....

  1. If you want more than one custom class defined in the same file (and accessed from somewhere else) you need to bundle them up:
 <Panel ux:Class="BogusBundleNeverActuallyToBeInstanced">
     <Page ux:Class="PageWithTitle">
        ....
     <Page ux:Class="anotherCustomPage">
         ....
 </Panel>

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. :slight_smile:

Yes, the second solution is what I was looking for! I want to keep my custom trivial classes in one file.

Thanks Remi