You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2019/10/09 17:05:58 UTC

[GitHub] [royale-asjs] cristallium opened a new issue #499: Uncaught TypeError: Cannot set property 'html' of undefined on j:Label on SDK 0.9.6

cristallium opened a new issue #499: Uncaught TypeError: Cannot set property 'html' of undefined on j:Label on SDK 0.9.6
URL: https://github.com/apache/royale-asjs/issues/499
 
 
   Hi,
   
   After several hours to try differents tests cases the following code thrown an  _**Cannot set property 'html' of undefined**_ on `a j:Label` and I don't understand why.
   
   **MonComptePanel.mxml**
   ```
   <j:ScrollableSectionContent 
       xmlns:fx="http://ns.adobe.com/mxml/2009" 
       xmlns:j="library://ns.apache.org/royale/jewel" 
       xmlns:js="library://ns.apache.org/royale/basic" 
       initComplete="ev_initComplete()">
       
       <js:states>
           <js:State name="login"/>
           <js:State name="loggued"/>
       </js:states>
   
       <j:beads>
           <js:SimpleStatesImpl/>
       </j:beads>
   
       <j:Group includeIn="login">
           <j:Label id="lbl_ident"/>
       </j:Group>
   
       <fx:Script>
           <![CDATA[
   
               private function ev_initComplete():void {
                   this.currentState = "login"; // this is useless
                   var str:String = "<p style='color:#ff6600'>Please log in.</p>";
                   lbl_ident.html = str; // here is the issue
               }
   
           ]]>
       </fx:Script>
   
   
   </j:ScrollableSectionContent>
   ```
   
   To reproduce the issue, code must be in
   **Main.mxlx**
   ```
   <j:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:js="library://ns.apache.org/royale/basic"  
                      xmlns:j="library://ns.apache.org/royale/jewel" 
                      xmlns:binding="org.apache.royale.binding.*" 
                      xmlns:local="*">
   	<j:valuesImpl>
   		<js:SimpleCSSValuesImpl />
   	</j:valuesImpl>
   
       <j:initialView >
           <j:View>
               <j:ApplicationMainContent selectedContent = "moncompte_panel">
                   <local:MonComptePanel name="moncompte_panel"/>
               </j:ApplicationMainContent>
           </j:View>
       </j:initialView>
   </j:Application>
   ```
   
   The full error is
   
   ```
   EventDispatcher.js:73 Uncaught TypeError: Cannot set property 'html' of undefined
       at MonComptePanel.MonComptePanel_ev_initComplete (MonComptePanel.mxml:28)
       at MonComptePanel.$EH0 (MonComptePanel.mxml:7)
       at MonComptePanel.goog.events.EventTarget.fireListeners (eventtarget.js:284)
       at Function.goog.events.EventTarget.dispatchEventInternal_ (eventtarget.js:382)
       at MonComptePanel.goog.events.EventTarget.dispatchEvent (eventtarget.js:196)
       at MonComptePanel.org.apache.royale.events.EventDispatcher.dispatchEvent (EventDispatcher.js:70)
       at MonComptePanel.org.apache.royale.core.HTMLElementWrapper.dispatchEvent (HTMLElementWrapper.js:254)
       at MonComptePanel.org.apache.royale.jewel.Container.addedToParent (Container.js:180)
       at org.apache.royale.jewel.ApplicationMainContent.org.apache.royale.core.UIBase.addElement (UIBase.js:410)
       at org.apache.royale.jewel.ApplicationMainContent.org.apache.royale.core.GroupBase.addElement (GroupBase.js:165)
   ```
   
   Here is full source code
   
   [TestRoyale4.zip](https://github.com/apache/royale-asjs/files/3708547/TestRoyale4.zip)
   
   Any ideas ?
   Regards

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services