Carlos, Thanks for your prompt response. It fix !!! Now we are dealing with
an external Popup, all this is for the migration of TitleWindow of flex to
royale. We believe it is the best way. Take this opportunity to
congratulate the framework, hopefully you have the first release version.
Gustavo.
public function popupByAS(event:Event):void
{
trace('In method byAs');
var onePopup:MyPopup = new MyPopup();
this.addElement(onePopup);
onePopup.open = true;
}
Where MyPopup.mxml
<?xml version="1.0" encoding="utf-8"?>
<j:PopUp xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:j="library://ns.apache.org/royale/jewel">
<j:Label text="Hello External"/>
</j:PopUp>
MyPopup.js:42 Uncaught TypeError: this.generateMXMLAttributes is not a
function
at new main.components.Form.MyPopup (MyPopup.js:42)
at Main.popupByAS (Main.mxml:22)
at Main.$EH1 (Main.mxml:51)
at Function.goog.events.fireListener [as googFireListener]
(events.js:753)
at
Object.org.apache.royale.core.HTMLElementWrapper.fireListenerOverride [as
fireListener] (HTMLElementWrapper.js:53)
at HTMLButtonElement.goog.events.handleBrowserEvent_ (events.js:879)
at HTMLButtonElement.f (events.js:296)
El lun., 16 dic. 2019 a las 13:11, Carlos Rovira (<[email protected]>)
escribió:
> Hi Carli,
>
> the main problem is that you need to add to the parent the popup created
> with
>
> addElement(onePopup);
>
> Notice that each time you'll be creating one popup and adding to the
> container, so maybe you need to create some logic to ensure creation and
> addition to parent is done just one time.
>
> An additional issue (that does not gives error) is that click event
> handlers has binding expressions. That's not needed
>
> instead of
>
> click="{this.popByMethod.open = true}"
>
> you write only:
>
> click="popByMethod.open = true"
>
>
> HTH
>
> Carlos
>
>
> El lun., 16 dic. 2019 a las 17:03, Carlos Rovira (<[email protected]>)
> escribió:
>
>> Hi Carli,
>> I'm going to try your code and see what I can report about it
>>
>> El lun., 16 dic. 2019 a las 16:56, De Carli Gustavo (<
>> [email protected]>) escribió:
>>
>>> Hello, someone could be oriented because I do not have the same behavior
>>> in the creation of a popup by msxml than by as. thank you very much
>>> Method, popupByAs, is the problem, does nothing.
>>>
>>> thank
>>>
>>>
>>> <?xml version="1.0" encoding="utf-8"?>
>>> <j:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
>>> xmlns:html="library://ns.apache.org/royale/html"
>>> xmlns:j="library://ns.apache.org/royale/jewel"
>>> xmlns:Button="main.components.Button.*"
>>> xmlns:Form="main.components.Form.*"
>>> xmlns:js="library://ns.apache.org/royale/basic"
>>> xmlns:c="components.*">
>>>
>>> <fx:Script>
>>> <![CDATA[
>>>
>>> import org.apache.royale.events.Event;
>>> import org.apache.royale.jewel.Button;
>>> import org.apache.royale.jewel.PopUp;
>>>
>>> public function popupByAS(event:Event):void
>>> {
>>> trace('In method byAs');
>>> var oneLabel:Label = new Label();
>>> oneLabel.text = "Hello by As";
>>> oneLabel.visible = true;
>>>
>>> var onePopup:PopUp = new PopUp();
>>> onePopup.content = oneLabel;
>>>
>>> onePopup.open = true;
>>> }
>>>
>>> ]]>
>>> </fx:Script>
>>>
>>> <j:initialView>
>>> <j:View>
>>> <j:Button id="btnByInMXML"
>>> text="By Method MXML"
>>> x="10"
>>> y="200"
>>> emphasis="primary"
>>> click="{this.popByMethod.open = true}"/>
>>>
>>>
>>> <j:PopUp id="popByMethod">
>>> <j:Label id="lblByMethod" text="Hello Method XML"/>
>>> </j:PopUp>
>>>
>>>
>>> <j:Button id="btnByInAS"
>>> text="By Metodo AS"
>>> x="10"
>>> y="200"
>>> emphasis="primary"
>>> click="{this.popupByAS(event)}"/>
>>> </j:View>
>>> </j:initialView>
>>> </j:Application>
>>>
>>>
>>>
>>
>> --
>> Carlos Rovira
>> http://about.me/carlosrovira
>>
>>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>