You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Carlos Rovira <ca...@apache.org> on 2017/01/15 20:39:35 UTC

[FlexJS] add HTMLElement to document.body

Hi,

how can I add the "positioner" or "element" created in "createElement"
method  to document.body instead to the parent component?

Thanks

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

Re: [FlexJS] add HTMLElement to document.body

Posted by yishayw <yi...@hotmail.com>.
I don't think there's a static reference to the application in FlexJS. See
[1] this discussion.

[1]
http://apache-flex-users.2333346.n4.nabble.com/FlexJS-How-to-use-SimpleAlert-from-a-class-that-s-not-a-IPopUpParent-td12941.html



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-add-HTMLElement-to-document-body-tp58319p58348.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] add HTMLElement to document.body

Posted by Alex Harui <ah...@adobe.com>.

On 1/16/17, 1:20 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com> wrote:

>Hi Alex,
>
>The MDL Dialog is a <dialog> html tag that is added to document.body
>So what's the way to get the Application instance in FlexJS?

So if it can only be added to document.body then findPopUpHost may not be
safe enough.  You may need to build out your own hook to it.

There is no standard way to get the Application because in the past there
was no consensus on the proper way to do it.  Some people hated globals,
some didn't like Singletons, etc.  t haven't tried it, but I think you can
create static properties in your MXML file and reference it elsewhere in
your code.

>
>I don't know how popups works on FlexJS but as in Flex SDK I suppose I
>should declare the dialog in external file or in <fx:Component> (don't now
>if this exist here) and not MXML to avoid insertion in the normal DOM
>tree,
>and operate like Alert.show() right?
>

Sounds right to me.

-Alex


Re: [FlexJS] add HTMLElement to document.body

Posted by Carlos Rovira <ca...@codeoscopic.com>.
Hi Alex,

The MDL Dialog is a <dialog> html tag that is added to document.body
So what's the way to get the Application instance in FlexJS? or is what you
said UIUtils.findPopUpHost? (I mean if UIUtils.findPopUpHost gives the
Application)

I don't know how popups works on FlexJS but as in Flex SDK I suppose I
should declare the dialog in external file or in <fx:Component> (don't now
if this exist here) and not MXML to avoid insertion in the normal DOM tree,
and operate like Alert.show() right?




2017-01-16 7:47 GMT+01:00 Alex Harui <ah...@adobe.com>:

>
>
> On 1/15/17, 12:39 PM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
> <carlos.rovira@gmail.com on behalf of carlosrovira@apache.org> wrote:
>
> >Hi,
> >
> >how can I add the "positioner" or "element" created in "createElement"
> >method  to document.body instead to the parent component?
>
> Not quite sure what you are looking for, but Application wraps the Body so
> accessing the Application might be helpful.  Also, there is a
> UIUtils.findPopUpHost that popups use to find a good parent.
>
> HTH,
> -Alex
>
>


-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

Re: [FlexJS] add HTMLElement to document.body

Posted by Alex Harui <ah...@adobe.com>.

On 1/16/17, 2:35 AM, "Harbs" <ha...@gmail.com> wrote:

>I know we’ve had this discussion already, but we definitely need a way to
>attach a FlexJS application to a specific element, and not the entire
>body.
>
>I cannot release my app that I’m migrating to FlexJS until we have a way
>to do this.

That sounds like a different Application class.  We can certainly have
different Application classes with different expectations.

My 2 cents,
-Alex


Re: [FlexJS] add HTMLElement to document.body

Posted by Harbs <ha...@gmail.com>.
I know we’ve had this discussion already, but we definitely need a way to attach a FlexJS application to a specific element, and not the entire body.

I cannot release my app that I’m migrating to FlexJS until we have a way to do this.

> On Jan 16, 2017, at 8:47 AM, Alex Harui <ah...@adobe.com> wrote:
> 
> but Application wraps the Body


Re: [FlexJS] add HTMLElement to document.body

Posted by Alex Harui <ah...@adobe.com>.

On 1/15/17, 12:39 PM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlosrovira@apache.org> wrote:

>Hi,
>
>how can I add the "positioner" or "element" created in "createElement"
>method  to document.body instead to the parent component?

Not quite sure what you are looking for, but Application wraps the Body so
accessing the Application might be helpful.  Also, there is a
UIUtils.findPopUpHost that popups use to find a good parent.

HTH,
-Alex