You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Justin Mclean <ju...@classsoftware.com> on 2017/02/07 07:37:10 UTC

[FlexJS] SimpleAlert and Alert not working

Hi,

This code:

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                xmlns:js="library://ns.apache.org/flexjs/basic">

    <fx:Script><![CDATA[
        import org.apache.flex.html.SimpleAlert;
        ]]></fx:Script>

    <js:initialView>
        <js:View>
            <js:TextButton text="Click Me" click="SimpleAlert.show('hello world', this)" />
        </js:View>
    </js:initialView>

</js:Application>

Gives an error when the show method is called.

Uncaught TypeError: Cannot read property 'show' of undefined

It looks to be that SimpleAlert is not added with goog.require and org.apache.flex.html doesn’t contain SimpleAlert but only contains Button, ButtonBase and TextButton for the above code.

How can you force it to be added?

I looked at the Alert and SimpleAlert examples as well and they also failed in the same way,

Thanks,
Justin


Re: [FlexJS] SimpleAlert and Alert not working

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> But it looks like something is broken when you trying to click="SimpleAlert.show('hello
> world', this)" - It may be a compiler bug.

Yep that’s exactly what I’m seeing.

Thanks,
Justin

Re: [FlexJS] SimpleAlert and Alert not working

Posted by piotrz <pi...@gmail.com>.
Hi Justin,

In TourJS SimpleAlert is working for me - I just checked [1]. But it looks
like something is broken when you trying to click="SimpleAlert.show('hello
world', this)" - It may be a compiler bug.

[1]
https://github.com/apache/flex-tourjs/blob/develop/examples/visualComponents/generalComponents/alert/SimpleAlert/src/main/flex/SimpleAlert.mxml

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-SimpleAlert-and-Alert-not-working-tp59072p59074.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.