-
3 Mar 2013 10:04 AM #1
Please do something to better explain "Layout run failed" errors.
Please do something to better explain "Layout run failed" errors.
I have an app that runs fine in 4.1.3. Upgrading to 4.2 RC shows a "layout run failed" error in the console, but because it tells you absolutely nothing, I have no idea what component is causing this. Please add at least the class name, id/itemId, or something (anything) to this error log message, because as it is now there is no way to determine anything about these errors.
-
3 Mar 2013 3:22 PM #2
Have you tried running it through the Page Analyzer? That may give you more information.
In general though, it isn't as simple as you might think to give feedback on why a layout failed. While there may only be a single omission causing the failure it isn't necessarily possible to know which of the many components and layouts involved is the one that is misconfigured.
Each container's layout specifies a series of constraints that must be satisfied but in isolation there often isn't a unique solution for those constraints. It's only in the context of all the layouts taken together that the constraints combine to specify a unique solution for all of the equations involved. When a layout fails it usually means that there aren't enough constraints to calculate all of the sizes involved but adding a new constraint can be done is so many ways that the library can't realistically guess which one was omitted.
For example, if the layout run fails to calculate the widths it could be because the parent container was missing a width configuration. Or maybe the container was supposed to shrink-wrap its children and it is the children that are missing a width configuration. For two components it isn't too bad but when they're nested dozens deep the problem could be with any one of them.
In short, the layouts often know that something is missing but it doesn't necessarily know what.
The Page Analyzer is your best bet as it can give you an indication of which part of the layout hierarchy caused the failure. It can't necessarily isolate the problem to a single layout but it can flash red lights on the layout branch that failed, narrowing your search.
-
3 Mar 2013 8:02 PM #3
Thanks, I had never even heard of the page-analyzer, and it took some Googling to even find out what it is.
Running my app through this tool does indicate a problem, but as you say, it doesn't really identify what the problem actually is.
I'm attaching a screen shot in case someone else might be able to better interpret what it is saying. The trigger text "hamur-view-impact-associatedImpacts-1036.containerChildrenSizeDone:dom (=undefined) - dirty: false - setBy: ??" doesn't tell me much. It also seems odd that the two child layouts under this one are both green/ok.
Any ideas? Could this be a bug in 4.2 RC?
-
3 Mar 2013 8:34 PM #4
Could be a bug.
Since everything is either calculated/configured they tend to be the most solid kinds of layouts. The only thing that jumps out is having an anchor layout at the root, typically you don't see that. What if you replace that with say, a card layout.Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
3 Mar 2013 10:35 PM #5
If associatedImpacts is a 'west' or 'east' region, and it is anchor layout, it needs to know its width in order to width its child components.
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
3 Mar 2013 11:06 PM #6
Thanks, Animal. Here's the jist of the border layout and the associatedImpacts. It's actually in the center region, and while that region doesn't have a width, the west region has an explicit width, so that the center and south regions take up the remaining screen width.
And in associatedImapcts, I'm using:Code:layout: "border" items: [ itemId: "impactTree" region: "west" width: 325 split: true collapsable: true xtype: "hamur-view-impact-impactTree" , itemId: "associatedImpacts" region: "center" xtype: "hamur-view-impact-associatedImpacts" , itemId: "availableImpacts" region: "south" height: "50%" split: false collapsable: true collapsed: true weight: -100 xtype: "hamur-view-impact-availableImpacts" ]
Do you see anything wrong with this? Also, again as far as I can tell, it works under 4.1.3 with no issue. Also, while the layout run failed message appears in the log, the app actually SEEMS to work correctly. That said, the layout run failing obviously can't be ignored.Code:layout: "anchor" anchor: "100% 100%"
Thanks again,
Brian
P.S. On the off chance that this means more to you than it does to me, I did a "build layout run spec" in the page analyzer, and this is the relevant section. The odd thing seems to be that the width and height for associatedImpacts seems to be getting calculated fine. Sorry to blast all this code at you, but I'd rather include too much than not enough and end up missing something important:
Code:"children" : [{ "allDone" : false, "done" : false, "id" : "anchor-1077", "type" : "anchor", "name" : "hamur-view-impact-associatedImpacts-1036<anchor>", "blocks" : [], "boxParent" : null, "isBoxParent" : true, "triggers" : [{ "name" : "hamur-view-impact-associatedImpacts-1036.containerChildrenSizeDone:dom", "prop" : "containerChildrenSizeDone", "dirty" : false, "missing" : true, "setBy" : "??" }, { "name" : "hamur-view-impact-associatedImpacts-1036-body.height:dom", "prop" : "height", "value" : 779, "dirty" : false, "missing" : false, "setBy" : "hamur-view-impact-associatedImpacts-1036<dock>" }, { "name" : "hamur-view-impact-associatedImpacts-1036-body.width:dom", "prop" : "width", "value" : 1102, "dirty" : false, "missing" : false, "setBy" : "hamur-view-impact-associatedImpacts-1036<dock>" } ] ...
-
4 Mar 2013 12:44 AM #7
How is mainPanel being sized?
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
4 Mar 2013 5:50 AM #8
-
4 Mar 2013 8:05 AM #9
Can we see some code?
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
4 Mar 2013 8:57 AM #10
Sure, I can try...I posted the layout info for the border layout and the associatedImpacts earlier. Is there something else that would make sense to see? This is part of a larger client app, so I can't just post everything, and I haven't had a chance to try and create an independent test case since it will take some time to replicate the setup. That said, if you think an independent test case may be the only way to diagnose it, I can try to create one today/tonight.
Thanks,
Brian


Reply With Quote
