| Summary: | Can not render commands multiple times in one div for "tool" style | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Szymon Brandys <Szymon.Brandys> | ||||
| Component: | Client | Assignee: | Susan McCourt <susan> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | susan | ||||
| Version: | 0.4 | ||||||
| Target Milestone: | 0.4 RC1 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Szymon Brandys
Created attachment 210438 [details]
Two "undefined" commands when "See Full Log" is non-href
thanks for the detailed description. I'm going to review these scenarios after implementing bug 360986. the bug is in your handling of the view all command, and in particular the looseness of the visibleWhen expression. I see that you defined a command with no image, no name, etc. The visibleWhen expression has a side effect of setting values on the command and then computing whether the command is valid for the item. But when this visibleWhen is called on the second render, it fails and blows out of the command code, so the rest does not render. So the first time you call renderCommands, you set the image and name and it validates as expected. The link gets drawn. But the second time through, it is still going to visit the "see all" command since you are rendering the same set of commands again. This time, it's evaluating the visibleWhen expression against the second set of items. Your visibleWhen wasn't strict enough to rule out items it doesn't understand. It had return item.ViewAllLink !== null but for items that don't match at all, the link will be "undefined" and this expression will evaluate to true. So then we try to render this partially formed command and it blows up. I could better protect the command framework against malformed commands, but then your symptom would have been double rendering of the link. So the bottom line is that if you want to render multiple item objects in a single div, you want to make sure that the commands contributed to that dom node will evaluate cleanly against all the items. I have a fix in my workspace, hopefully will push it tonight, I have to fix a couple more bugs. pushed. |