Hi Alex,

Many thanks for this solution. I have implemented it and it seems to be ok
right now. It's enough if I pickup one level up parent. Currently I used
that [1] function only in NavigationLayout component, but if I see that
some of the component will generate additional container after upgrade I
will use it. I have raised issue and close it after some time. [2]

[1] https://bit.ly/2FKq8Yp
[2] https://github.com/apache/royale-asjs/issues/222

Thanks,
Piotr


2018-05-03 11:02 GMT+02:00 Alex Harui <[email protected]>:

> Thinking about it for a few minutes, I have the following thoughts:
>
> The primary rule should be that you can walk the parent chain from any
> HTMLElement.  You could override the parent getter to return the right
> value.
>
> For debugging, it would be helpful to have royale_wrapper on every
> element, but if you know the topology, you can probably examine a childNode
> or parentNode and find its royale_wrapper.
>
> Of course, I could be wrong...
> -Alex
>
> On 5/3/18, 1:02 AM, "Piotr Zarzycki" <[email protected]> wrote:
>
>     Alex,
>
>     I had some session yesterday with that and I think I have found the
> reason.
>     It is connected with how MDL is working. Let's start from the initial
> code
>
>     This is how code looks like:
>     <js:View> -> After translation -> <div>
>          <mdl:NavigationLayout currentState="Examples"
>     className.Examples="examplesBackground"></mdl:NavigationLayout> ->
> after
>     translation -> <div>
>     </js:View>
>
>     In above case the parent of NavigationLayout should be, a View, but it
>     isn't. Each MDL component is going through some kind of invalidation
>     mechanism - it's called upgrading. Sometime in the results of
> upgrading MDL
>     library is adding additional containers. In above case our translated
> code
>     should looks like:
>
>     <div>
>        <div class="examplesBackground"></div>
>     </div>
>
>     BUT it looks like that:
>
>     <div>
>        <div class="mdl-layout__container"> - This ELEMENT is not a Royale
>     creation. It doesn't have  royale_wrapper.
>             <div class="examplesBackground"></div>
>         </div>
>     </div>
>
>     Initial state is setting up correctly along with initial class "
>     examplesBackground"
>     - However changes are not possible because we are checking whether
> parent
>     exists and it exists but it's not a Royale component.
>
>     I'm not sure how to fix that yet.
>
>     Thanks, Piotr
>
>
>     2018-05-01 22:26 GMT+02:00 Alex Harui <[email protected]>:
>
>     > An element without a royale_wrapper breaks the fundamental contract
> in
>     > UIBase.  I recommend that you figure that part out.
>     >
>     > Good luck,
>     > -Alex
>     >
>     > On 5/1/18, 12:33 PM, "Piotr Zarzycki" <[email protected]>
> wrote:
>     >
>     >     In the other words - My website is loaded and component have
> initial
>     > state.
>     >
>     >     Than I'm clicking on the button I'm changing state for that
> component.
>     >
>     >     Piotr
>     >
>     >     On Tue, May 1, 2018, 7:27 PM Piotr Zarzycki <
> [email protected]
>     > >
>     >     wrote:
>     >
>     >     > This component is already on the display list. I'm changing
> States
>     > of that
>     >     > component. That's the weirdest thing.
>     >     >
>     >     > Piotr
>     >     >
>     >     > On Tue, May 1, 2018, 7:06 PM Alex Harui
> <[email protected]>
>     > wrote:
>     >     >
>     >     >> Hi Piotr,
>     >     >>
>     >     >> What is the call stack at that point?  Should the component
> be on
>     > the
>     >     >> display list or is it still having its properties set up per
> the
>     >     >> lifecycle?  If it is just having its properties set up, there
>     > should be
>     >     >> another call to setClassName in addedToParent and parent
> should not
>     > be
>     >     >> undefined.
>     >     >>
>     >     >> -Alex
>     >     >>
>     >     >> On 5/1/18, 9:58 AM, "piotrz" <[email protected]> wrote:
>     >     >>
>     >     >>     Alex,
>     >     >>
>     >     >>     I just checked getter for parent and royale_wrapper on
> element
>     > is
>     >     >> undefined.
>     >     >>
>     >     >>     <
>     >     >> https://na01.safelinks.protection.outlook.com/?url=
>     > http%3A%2F%2Fapache-royale-development.20373.n8.nabble.
>     > com%2Ffile%2Ft1%2Froyale_wrapper_undefined.png&data=02%
>     > 7C01%7Caharui%40adobe.com%7C4df3cf45055440294eb908d5af84cc3e%
>     > 7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%
> 7C636607907300284114&sdata=%
>     > 2BWvX%2B84oVUsWZO4Q3rO4QwPRnR1TcZJKseXYJB1ni8U%3D&reserved=0>
>     >     >>
>     >     >>
>     >     >>     Piotr
>     >     >>
>     >     >>
>     >     >>
>     >     >>
>     >     >>
>     >     >>     --
>     >     >>     Sent from:
>     >     >> https://na01.safelinks.protection.outlook.com/?url=
>     > http%3A%2F%2Fapache-royale-development.20373.n8.nabble.
>     > com%2F&data=02%7C01%7Caharui%40adobe.com%
> 7C4df3cf45055440294eb908d5af84
>     > cc3e%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%
>     > 7C636607907300284114&sdata=W4AV3qDPNfO1VlCywDh5bd5u9Oa7Fh
>     > 0JXDhzrFIp%2FMM%3D&reserved=0
>     >     >>
>     >     >>
>     >     >>
>     >
>     >
>     >
>
>
>     --
>
>     Piotr Zarzycki
>
>     Patreon: *https://na01.safelinks.protection.outlook.com/?url=
> https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%
> 7Caharui%40adobe.com%7C7640613e7868437002e208d5b0cc25c9%
> 7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636609313211834709&sdata=
> y4uHhs%2BZXUSPFFQR26y3lP5tGlYizJJfB0r3lR%2B%2FiG4%3D&reserved=0
>     <https://na01.safelinks.protection.outlook.com/?url=
> https%3A%2F%2Fwww.patreon.com%2Fpiotrzarzycki&data=02%7C01%
> 7Caharui%40adobe.com%7C7640613e7868437002e208d5b0cc25c9%
> 7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636609313211834709&sdata=
> y4uHhs%2BZXUSPFFQR26y3lP5tGlYizJJfB0r3lR%2B%2FiG4%3D&reserved=0>*
>
>
>


-- 

Piotr Zarzycki

Patreon: *https://www.patreon.com/piotrzarzycki
<https://www.patreon.com/piotrzarzycki>*

Reply via email to