Hi Alex,
I spent some time on the issue and I am sure it is related with state
but I am not able to discover the root cause. I removed the inner-nested
state definitions that are same with parent container but still getting
the exception.
But, when I changed the code
from : <s:Group id="mainApp" width="100%" height="100%"
excludeFrom="loggedOutState, dummyState">
to : <s:Group id="mainApp" width="100%" height="100%" >
the exception disappears. I am sharing the code with exception for your
interest :
https://drive.google.com/open?id=1o8y522jZhlz7Wmipl36FyHMqTMjMGI8t
After removing "excludeFrom" from the code and move one step further I
am faced with another issue :
SkinnableContainer.js:241 Uncaught TypeError: Cannot read property
'contentView' of null
at
com.likya.pinara.main.PinaraUI.spark.components.SkinnableContainer.addElement
(SkinnableContainer.js:241)
at
Function.org.apache.royale.utils.MXMLDataInterpreter.org_apache_royale_utils_MXMLDataInterpreter_initializeStrandBasedObject
(MXMLDataInterpreter.js:236)
at
Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLArray
(MXMLDataInterpreter.js:125)
at
Function.org.apache.royale.utils.MXMLDataInterpreter.generateMXMLInstances
(MXMLDataInterpreter.js:266)
at
com.likya.pinara.main.PinaraUI.spark.components.SkinnableContainer.createChildren
(SkinnableContainer.js:190)
at com.likya.pinara.main.PinaraUI.mx.core.UIComponent.initialize
(UIComponent.js:731)
at com.likya.pinara.main.PinaraUI.mx.core.UIComponent.addedToParent
(UIComponent.js:288)
at
com.likya.pinara.main.PinaraUI.spark.components.SkinnableContainer.addedToParent
(SkinnableContainer.js:177)
at
PinaraUI_mx_managers_SystemManager.org.apache.royale.core.UIBase.addElement
(UIBase.js:414)
at
PinaraUI_mx_managers_SystemManager.mx.managers.SystemManager.addChild
(SystemManager.js:109)
At line 241 of SkinnabeContainer.js :
var /** @type {org.apache.royale.core.IParent} */ contentView =
org.apache.royale.utils.Language.as(this.getLayoutHost().contentView,
org.apache.royale.core.IParent); *Uncaught TypeError: Cannot read
property 'contentView' of null*
this.getLayoutHost() returns null
And here is the sources for the second exception :
https://drive.google.com/open?id=1F4eFfx2Ayf7Q-rMPTJsuDCFiQDcBLcRv
Thanks,
Serkan
8.12.2018 00:59 tarihinde Alex Harui yazdı:
HI Serkan,
That is the issue with the nested states. Please make sure you’ve
cleaned all those up. Then if it is still happening, I will look again.
Thanks,
-Alex
*From: *Serkan Taş <[email protected]>
*Reply-To: *"[email protected]" <[email protected]>
*Date: *Friday, December 7, 2018 at 1:47 PM
*To: *"[email protected]" <[email protected]>
*Subject: *Re: Work on Emulation
Hi,
After compiling the new source, the issue related with namespaces is
fixed.
For the next step, I am getting error related with the source
*StatesWithTransitionsImpl.js, *here is the console log for firefox :
unreachable code after return statement[Learn More] SystemManager.js:196:2
unreachable code after return statement[Learn More]
JobListWithDetails.js:522:4
unreachable code after return statement[Learn More] SystemManager.js:196:2
invalidateParentSizeAndDisplayList not implemented
Language.js:238:7
*TypeError: parent is undefined; can't access its "getElementIndex"
property[Learn More] StatesWithTransitionsImpl.js:328:39
*
org_apache_royale_core_StatesWithTransitionsImpl_apply
file:///D:/dev/royale-emulation-works/github/bin/js-debug/org/apache/royale/core/StatesWithTransitionsImpl.js:328
org_apache_royale_core_StatesWithTransitionsImpl_stateChangeHandler
file:///D:/dev/royale-emulation-works/github/bin/js-debug/org/apache/royale/core/StatesWithTransitionsImpl.js:131
org_apache_royale_core_StatesWithTransitionsImpl_initialStateHandler
file:///D:/dev/royale-emulation-works/github/bin/js-debug/org/apache/royale/core/StatesWithTransitionsImpl.js:65
<anonymous> self-hosted:974 fireListeners
file:///D:/dev/royale-emulation-works/github/bin/js-debug/library/closure/goog/events/eventtarget.js:284
dispatchEventInternal_
file:///D:/dev/royale-emulation-works/github/bin/js-debug/library/closure/goog/events/eventtarget.js:382
dispatchEvent
file:///D:/dev/royale-emulation-works/github/bin/js-debug/library/closure/goog/events/eventtarget.js:196
dispatchEvent
file:///D:/dev/royale-emulation-works/github/bin/js-debug/org/apache/royale/events/EventDispatcher.js:71
dispatchEvent
file:///D:/dev/royale-emulation-works/github/bin/js-debug/org/apache/royale/core/HTMLElementWrapper.js:250
addedToParent
file:///D:/dev/royale-emulation-works/github/bin/js-debug/spark/components/SkinnableContainer.js:179
addElement
file:///D:/dev/royale-emulation-works/github/bin/js-debug/org/apache/royale/core/UIBase.js:414
addChild
file:///D:/dev/royale-emulation-works/github/bin/js-debug/mx/managers/SystemManager.js:109
mx_managers_SystemManager_initializeTopLevelWindow
file:///D:/dev/royale-emulation-works/github/bin/js-debug/mx/managers/SystemManager.js:249
start
file:///D:/dev/royale-emulation-works/github/bin/js-debug/mx/managers/SystemManager.js:232
<anonymous>
file:///D:/dev/royale-emulation-works/github/bin/js-debug/index.html:1051
Source map error: TypeError: NetworkError when attempting to fetch
resource.
Resource URL:
file:///D:/dev/royale-emulation-works/github/bin/js-debug/mx/managers/SystemManager.js
Source Map URL: ./SystemManager.js.map[Learn More]
The source :
org.apache.royale.core.StatesWithTransitionsImpl.prototype.org_apache_royale_core_StatesWithTransitionsImpl_apply
= function(oldState, s) {
var /** @type {Array} */ arr = s.overrides;
var foreachiter10_target = arr;
for (var foreachiter10 in foreachiter10_target)
{
var o = foreachiter10_target[foreachiter10];
{
if (org.apache.royale.utils.Language.is(o,
org.apache.royale.states.AddItems)) {
var /** @type {Object} */ ai = o;
if (ai.items == null) {
ai.items = ai.itemsDescriptor.items;
if (ai.items == null) {
ai.items =
org.apache.royale.utils.MXMLDataInterpreter.generateMXMLArray(ai.document,
null, ai.itemsDescriptor.descriptor);
ai.itemsDescriptor.items = ai.items;
}
}
var /** @type {boolean} */ childrenAdded = false;
var foreachiter11_target = ai.items;
for (var foreachiter11 in foreachiter11_target)
{
var item = foreachiter11_target[foreachiter11];
{
if
(!this.org_apache_royale_core_StatesWithTransitionsImpl_isItemInState(item,
oldState)) {
var /** @type {Object} */ parent = ai.document;
if (ai.destination != null)
parent = parent[ai.destination];
if (ai.relativeTo != null) {
var /** @type {Object} */ child = ai.document[ai.relativeTo];
if (ai.destination == null)
parent = child.parent;
*var /** @type {number} */ index = parent.getElementIndex(child);*
if (ai.position == "after")
index++;
parent.addElementAt(item, index);
childrenAdded = true;
} else {
parent.addElement(item);
childrenAdded = true;
}
}
}}
if (childrenAdded && org.apache.royale.utils.Language.is(parent,
org.apache.royale.core.IContainer))
parent.childrenAdded();
} else if (org.apache.royale.utils.Language.is(o,
org.apache.royale.states.SetProperty)) {
var /** @type {Object} */ sp = o;
if (sp.target != null) {
sp.previousValue = sp.document[sp.target][sp.name];
sp.document[sp.target][sp.name] = sp.value;
} else {
sp.previousValue = sp.document[sp.name];
sp.document[sp.name] = sp.value;
}
} else if (org.apache.royale.utils.Language.is(o,
org.apache.royale.states.SetEventHandler)) {
var /** @type {Object} */ seh = o;
if (seh.target != null) {
seh.document[seh.target].addEventListener(seh.name,
seh.handlerFunction);
} else {
seh.document.addEventListener(seh.name, seh.handlerFunction);
}
}
}}
};
Thanks,
Serkan
7.12.2018 22:47 tarihinde Serkan Taş yazdı:
Okay Alex Thank you. I am going to remove this kind of usages.
Serkan
7.12.2018 22:39 tarihinde Alex Harui yazdı:
I fixed the fact that an item used in nested states where the
containing states were different than a child’s states was
being put in the output list more than once, resulting in the
duplicate keys issue.
The exception I saw in your code is that when you have a
parent and child being added to or removed from the same
state, the current state handllng code doesn’t like it because
the parent may not have been created before the child or vice
versa, and we don’t want to increase complexity of the state
handling in these cases, since it doesn’t make sense to have:
<Group id=”MainApp” excludeFrom”loggedOut”>
<MenuBar excludeFrom=”loggedOut” />
</Group>
-Alex
*From: *Serkan Taş <[email protected]>
<mailto:[email protected]>
*Reply-To: *"[email protected]"
<mailto:[email protected]> <[email protected]>
<mailto:[email protected]>
*Date: *Friday, December 7, 2018 at 11:32 AM
*To: *"[email protected]"
<mailto:[email protected]> <[email protected]>
<mailto:[email protected]>
*Subject: *Re: Work on Emulation
Hi Alex,
Thank you for the good news. I am going to try to build the
libraries locally, guess i can. And going to remove nested
include/exclude declarations.
As far as I remember you fixed the include/exclude issue
before, I am surprised to see the same bug here. Is it
something different ?
Serkan.
7.12.2018 22:23 tarihinde Alex Harui yazdı:
OK, The problem was that some addDependency calls were
being incorrectly computed and added to the output. I
pushed a fix for that. If you don’t want to wait for the
nightly or can’t build from sources, you can get past this
problem by hand-editing the index.html. For each
exception you should find the entry in there twice. So
for mx_internal, you’ll see two addDependency calls and
the second one will be missing dependencies. Remove that
second one and the exception will go away.
Once I got that exception to go away, there was one
remaining exception due to nested states again. The
menubar above “messagePanel” is being included/excluded
from the same state as a containing parent, in this case
“mainApp”.
HTH,
-Alex