You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Carlos Rovira <ca...@apache.org> on 2018/12/30 10:54:52 UTC

Jewel PopUp component: and reset the content

Hi,

I'm working this days in a PopUp component that puts some content (defined
in CSS or in MXML) in a PopUp.
The component is now working a near to be finished, just need to solve few
issues.

What I'm not sure is about content life cycle. Should the content be
removed when close the popup and be recreated from scratch when open again?
Or should the content be responsible of reset the its state if needed.

Since the content can be defined in CSS through like this:

.somePopUpContent
{
IPopUp: ClassReference("components.SomePopUpContent")
}

and then

<j:PopUp id="popup1" className="somePopUpContent" modal="true"/>

or in MXML:

<j:PopUp id="popup2">
     <c:FormExample label="Form example in a PopUp"/>
</j:PopUp>

In the MXML case you can eventually has bindings, so I think recreating
from scratch does not seems a good idea.

the Alert is another case of pop up, but since it use to be a text and just
some buttons, does not seems to be affected by this problems, and each time
is recreated.

This kind of popup that can be modal or non modal, seems to be more like
any other content that is navigated in other components, and those
components just show/hide the content.

By definition a modal/non-modal window is just a child of the interface
that is shown in front of the rest of the application, so my bet is not to
deal with recreation and just left as it's now. So if the user needs to
reset the form state, is the user who need to create some reset functions
and call it when the popup is open again if he needs that.



-- 
Carlos Rovira
http://about.me/carlosrovira

Re: Jewel PopUp component: and reset the content

Posted by Carlos Rovira <ca...@apache.org>.
Hi Alex,

thanks, I think right now this PopUp component is ok with those rules, so I
think is finished for now.
The instance is like any other screen, it persist and the popup just
show/hide like any other screen.

Thanks! :)



El lun., 31 dic. 2018 a las 8:04, Alex Harui (<ah...@adobe.com.invalid>)
escribió:

> IMO, Flex didn't care about the lifecycle of content in a popup (other
> than the initial creation should follow the same lifecycle as any other
> component), and Royale shouldn't either.  I think it is purely a
> memory/performance trade-off.  Alert is so simple, it is easy to create it
> brand new each time, not to mention that many apps never need to show an
> Alert.  But a huge popup that takes too long to create might want to save
> an instance of itself it is going to re-appear again later.
>
> My 2 cents,
> -Alex
>
> On 12/30/18, 2:55 AM, "Carlos Rovira" <ca...@apache.org> wrote:
>
>     Hi,
>
>     I'm working this days in a PopUp component that puts some content
> (defined
>     in CSS or in MXML) in a PopUp.
>     The component is now working a near to be finished, just need to solve
> few
>     issues.
>
>     What I'm not sure is about content life cycle. Should the content be
>     removed when close the popup and be recreated from scratch when open
> again?
>     Or should the content be responsible of reset the its state if needed.
>
>     Since the content can be defined in CSS through like this:
>
>     .somePopUpContent
>     {
>     IPopUp: ClassReference("components.SomePopUpContent")
>     }
>
>     and then
>
>     <j:PopUp id="popup1" className="somePopUpContent" modal="true"/>
>
>     or in MXML:
>
>     <j:PopUp id="popup2">
>          <c:FormExample label="Form example in a PopUp"/>
>     </j:PopUp>
>
>     In the MXML case you can eventually has bindings, so I think recreating
>     from scratch does not seems a good idea.
>
>     the Alert is another case of pop up, but since it use to be a text and
> just
>     some buttons, does not seems to be affected by this problems, and each
> time
>     is recreated.
>
>     This kind of popup that can be modal or non modal, seems to be more
> like
>     any other content that is navigated in other components, and those
>     components just show/hide the content.
>
>     By definition a modal/non-modal window is just a child of the interface
>     that is shown in front of the rest of the application, so my bet is
> not to
>     deal with recreation and just left as it's now. So if the user needs to
>     reset the form state, is the user who need to create some reset
> functions
>     and call it when the popup is open again if he needs that.
>
>
>
>     --
>     Carlos Rovira
>
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C54a8c3fa650940b462bc08d66e45440d%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636817641127660708&amp;sdata=E43zge%2FgRFeDC0YJ8t5kh4gB0AZL4TfxXLcodz2RhHc%3D&amp;reserved=0
>
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: Jewel PopUp component: and reset the content

Posted by Alex Harui <ah...@adobe.com.INVALID>.
IMO, Flex didn't care about the lifecycle of content in a popup (other than the initial creation should follow the same lifecycle as any other component), and Royale shouldn't either.  I think it is purely a memory/performance trade-off.  Alert is so simple, it is easy to create it brand new each time, not to mention that many apps never need to show an Alert.  But a huge popup that takes too long to create might want to save an instance of itself it is going to re-appear again later.

My 2 cents,
-Alex

On 12/30/18, 2:55 AM, "Carlos Rovira" <ca...@apache.org> wrote:

    Hi,
    
    I'm working this days in a PopUp component that puts some content (defined
    in CSS or in MXML) in a PopUp.
    The component is now working a near to be finished, just need to solve few
    issues.
    
    What I'm not sure is about content life cycle. Should the content be
    removed when close the popup and be recreated from scratch when open again?
    Or should the content be responsible of reset the its state if needed.
    
    Since the content can be defined in CSS through like this:
    
    .somePopUpContent
    {
    IPopUp: ClassReference("components.SomePopUpContent")
    }
    
    and then
    
    <j:PopUp id="popup1" className="somePopUpContent" modal="true"/>
    
    or in MXML:
    
    <j:PopUp id="popup2">
         <c:FormExample label="Form example in a PopUp"/>
    </j:PopUp>
    
    In the MXML case you can eventually has bindings, so I think recreating
    from scratch does not seems a good idea.
    
    the Alert is another case of pop up, but since it use to be a text and just
    some buttons, does not seems to be affected by this problems, and each time
    is recreated.
    
    This kind of popup that can be modal or non modal, seems to be more like
    any other content that is navigated in other components, and those
    components just show/hide the content.
    
    By definition a modal/non-modal window is just a child of the interface
    that is shown in front of the rest of the application, so my bet is not to
    deal with recreation and just left as it's now. So if the user needs to
    reset the form state, is the user who need to create some reset functions
    and call it when the popup is open again if he needs that.
    
    
    
    -- 
    Carlos Rovira
    https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&amp;data=02%7C01%7Caharui%40adobe.com%7C54a8c3fa650940b462bc08d66e45440d%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636817641127660708&amp;sdata=E43zge%2FgRFeDC0YJ8t5kh4gB0AZL4TfxXLcodz2RhHc%3D&amp;reserved=0