As of release 3.20021.27 (yesterday), controls which are instances of a Component have lost several properties including X, Y, Height, Width, and any Fill or Color definitions when viewed in Studio. They all bunch to X=0, y=0, for example, despite individual X and Y settings still showing their correct values. The app plays in Player OK, however.
I can sort of cure this by selecting all controls on a given page, cutting them, and then pasting back (so CtrlA, CtrlX, CtrlV). They then show correctly in Edit mode in Studio, but lose their values again when I hit Preview (F5).
If I save the app in this state and publish it, all controls show correctly. So it seems the Studio application is failing to implement properties in Component instances - they are probably defaulting to the sample settings within the Components themselves, I guess.
Solved! Go to Solution.
Yes, @Eickhel, agreed! Got to the same conclusion after a day experimenting..
If, as is often recommended, you typically create a global variable in the OnStart event to define styling properties - say,
Set(
gStyles,
{
marginX: 50,
headerY: 35,
ctrlFill: RGBA(200,200,200,1) //etc etc
}
)
and then use this to define properties in Component instances, they now fail, as of release 3.20021.27. Other non-Component controls are still ok.
Bizarrely, local variables created within the page's OnVisible event still work OK. So if your Component instance's X needs to be marginX, you can add this to its screen's OnVisible event
UpdateContext(
{
Styles: gStyles
}
)
set your Component instance's X to Styles.marginX, and all is fine.
So, Microsoft, is this now a permanent feature, or are you going to restore the ability to use global variables with Components?? Do I start remaking apps, or wait for a fix?
I'm having the exact same issue:
I also had an issue with the components losing their X & Y properties while on mobile but received no response
Link To My Original Post:
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Ok, I think I've narrowed it down to something... I don't know if it's the same exact case as the others but if any properties of the component comes from a public variable ( Set ) it doesn't stay. If the property comes from a local variable ( UpdateContext ) or a Collection it works and the values stay after saving and opening again.
Hope it helps
Yes, @Eickhel, agreed! Got to the same conclusion after a day experimenting..
If, as is often recommended, you typically create a global variable in the OnStart event to define styling properties - say,
Set(
gStyles,
{
marginX: 50,
headerY: 35,
ctrlFill: RGBA(200,200,200,1) //etc etc
}
)
and then use this to define properties in Component instances, they now fail, as of release 3.20021.27. Other non-Component controls are still ok.
Bizarrely, local variables created within the page's OnVisible event still work OK. So if your Component instance's X needs to be marginX, you can add this to its screen's OnVisible event
UpdateContext(
{
Styles: gStyles
}
)
set your Component instance's X to Styles.marginX, and all is fine.
So, Microsoft, is this now a permanent feature, or are you going to restore the ability to use global variables with Components?? Do I start remaking apps, or wait for a fix?
Hi @JonathanGibbs @Eickhel @mdevaney ,
A fix was rolled out earlier today if you can check that components are working for you now.