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/19 00:15:22 UTC

[FlexJS] calling a method over an object that can't be declared as HTMLDialogElement

Hi,

I have a <dialog> object, but as HTMLDialogElement is something new, I
don't have this API available so I think I only can have this kind of
declaration right?

COMPILE::JS
private var dialog:HTMLElement; //HTMLDialogElement;

but now my problem is how to call the method "showModal()".

I try call. -> showModal.call(dialog)
and brackets dialog['showModal']()

but nothing works

Whats the way to do this in FlexJS?

Thanks


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

Re: [FlexJS] calling a method over an object that can't be declared as HTMLDialogElement

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

just check the code at [1] and I think that code is from JS. Is that want I
want to do but in FlexJS/AS3, just as I did in the old days with Flash/AS3.
I assume that I should be able to do the same in FlexJS/AS3. Maybe just was
a problem with the actual case that involve a polyfill that wan't working
in the right way.

Anyway, thanks for pointing that! :)



2017-01-19 12:30 GMT+01:00 piotrz <pi...@gmail.com>:

> Hmm...It is working in that way:
>
> onElementMdlComponentUpgraded - Is a event handler which is raised by MDL
> javascript library when components are ready.
> - Once it's ready I'm taking object of snackbar  [1]
> - In method show line 128 - I'm using from this object "showSnackbar"
> function
>
> [1]
> https://github.com/google/material-design-lite/blob/
> 88872e672e41c56af0a78a35b34373b8c4a8c49d/src/snackbar/snackbar.js
>
> Piotr
>
>
>
> -----
> Apache Flex PMC
> piotrzarzycki21@gmail.com
> --
> View this message in context: http://apache-flex-
> development.2333347.n4.nabble.com/FlexJS-calling-a-method-
> over-an-object-that-can-t-be-declared-as-HTMLDialogElement-
> tp58428p58461.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>



-- 

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] calling a method over an object that can't be declared as HTMLDialogElement

Posted by piotrz <pi...@gmail.com>.
Hmm...It is working in that way:

onElementMdlComponentUpgraded - Is a event handler which is raised by MDL
javascript library when components are ready.
- Once it's ready I'm taking object of snackbar  [1]
- In method show line 128 - I'm using from this object "showSnackbar"
function

[1]
https://github.com/google/material-design-lite/blob/88872e672e41c56af0a78a35b34373b8c4a8c49d/src/snackbar/snackbar.js

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-calling-a-method-over-an-object-that-can-t-be-declared-as-HTMLDialogElement-tp58428p58461.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] calling a method over an object that can't be declared as HTMLDialogElement

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

I think we 're talking about different things ;)
I'm referring to call methods in a more *dirty* way: with brackets (I-e:
object[func]()) or with call or apply
The Toast example is using a listener what I think is ok, but don't see the
relation, or I'm missing something?

thanks


2017-01-19 10:11 GMT+01:00 piotrz <pi...@gmail.com>:

> Sorry Carlos it's in the Toast [1] - snackbar object. In order to know what
> is the name of the object I looked into JS code of MDL. I'm taking it in
> handler: onElementMdlComponentUpgraded
>
> [1]
> https://github.com/apache/flex-asjs/blob/develop/frameworks/projects/
> MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Toast.as
>
> Piotr
>
>
>
> -----
> Apache Flex PMC
> piotrzarzycki21@gmail.com
> --
> View this message in context: http://apache-flex-
> development.2333347.n4.nabble.com/FlexJS-calling-a-method-
> over-an-object-that-can-t-be-declared-as-HTMLDialogElement-
> tp58428p58449.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>



-- 

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] calling a method over an object that can't be declared as HTMLDialogElement

Posted by piotrz <pi...@gmail.com>.
Sorry Carlos it's in the Toast [1] - snackbar object. In order to know what
is the name of the object I looked into JS code of MDL. I'm taking it in
handler: onElementMdlComponentUpgraded

[1]
https://github.com/apache/flex-asjs/blob/develop/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/Toast.as

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-calling-a-method-over-an-object-that-can-t-be-declared-as-HTMLDialogElement-tp58428p58449.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] calling a method over an object that can't be declared as HTMLDialogElement

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

I didn't see nothing in SnackBar, maybe you want to point to other class?

thanks!


2017-01-19 7:53 GMT+01:00 piotrz <pi...@gmail.com>:

> Carlos,
>
> I was doing this thing in some of MDL components. It was matter of getting
> object of this components. Maybe this dialog is not the right object. Take
> a
> look into the Snackbar maybe it will help.
>
> Piotr
>
>
>
> -----
> Apache Flex PMC
> piotrzarzycki21@gmail.com
> --
> View this message in context: http://apache-flex-
> development.2333347.n4.nabble.com/FlexJS-calling-a-method-
> over-an-object-that-can-t-be-declared-as-HTMLDialogElement-
> tp58428p58437.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>



-- 

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] calling a method over an object that can't be declared as HTMLDialogElement

Posted by piotrz <pi...@gmail.com>.
Carlos,

I was doing this thing in some of MDL components. It was matter of getting
object of this components. Maybe this dialog is not the right object. Take a
look into the Snackbar maybe it will help.

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-calling-a-method-over-an-object-that-can-t-be-declared-as-HTMLDialogElement-tp58428p58437.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: [FlexJS] calling a method over an object that can't be declared as HTMLDialogElement

Posted by Alex Harui <ah...@adobe.com>.
On 1/18/17, 4:42 PM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlosrovira@apache.org> wrote:

>Finaly I get HTMLDialogElement compile, don't know why it didn't compile
>before...some code gremlin ;)
>Right, so I got it working :)...
>
>... but still don't know how to call a function with "call" ,  "apply" or
>brackets "['fun´]()"
>
>can I do this in FlexJS?
>

What error are you getting?


-Alex


Re: [FlexJS] calling a method over an object that can't be declared as HTMLDialogElement

Posted by Carlos Rovira <ca...@apache.org>.
Finaly I get HTMLDialogElement compile, don't know why it didn't compile
before...some code gremlin ;)
Right, so I got it working :)...

... but still don't know how to call a function with "call" ,  "apply" or
brackets "['fun´]()"

can I do this in FlexJS?






2017-01-19 1:15 GMT+01:00 Carlos Rovira <ca...@apache.org>:

> Hi,
>
> I have a <dialog> object, but as HTMLDialogElement is something new, I
> don't have this API available so I think I only can have this kind of
> declaration right?
>
> COMPILE::JS
> private var dialog:HTMLElement; //HTMLDialogElement;
>
> but now my problem is how to call the method "showModal()".
>
> I try call. -> showModal.call(dialog)
> and brackets dialog['showModal']()
>
> but nothing works
>
> Whats the way to do this in FlexJS?
>
> Thanks
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>


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