We have moved to GitHub Issues
You are viewing the read-only archive of Umbraco's issue tracker. To create new issues, please head over to GitHub Issues.
Make sure to read the blog posts announcing the move for more information.
Created by Markus Johansson 16 Sep 2013, 12:09:53 Updated by Per Ploug 01 Oct 2013, 09:40:13
When working in a custom tree the custom items in the tree i implemented using the "BaseTree"-class:
public class loadSettings : BaseTree
This solution used to work in v4 & v6 and basicly loads the "/umbraco/NewsletterStudio/Pages/Settings.aspx"-file in the contentFrame aread.
In version 7 this doesn't work, and nothing happens when clicking on the node.
Here is the code:
protected override void CreateRootNode(ref XmlTreeNode rootNode) {
rootNode.NodeID = "rootSettings"; rootNode.NodeType = "newsletterstudio_settings";
rootNode.Icon = "settingMasterDatatype.gif"; rootNode.OpenIcon = "settingMasterDatatype.gif"; rootNode.Action = string.Format("javascript:UmbClientMgr.contentFrame('/umbraco/NewsletterStudio/Pages/Settings.aspx');");
rootNode.Menu.Clear();
// Removes the small "open folder" icon rootNode.Source = null;
}
I have also looked at another situation where the Action is on one of the child nodes, this works just fine:
public override void Render(ref XmlTree tree) {
ContextFacade container = ContextFactory.GetInstance();
foreach (var subscription in container.Subscriptions)
{
XmlTreeNode node = XmlTreeNode.Create(this);
node.Text = subscription.Name;
node.NodeType = "subscription";
node.NodeID = subscription.UniqueID;
node.OpenIcon = "table.png";
node.Icon = "table.png";
node.Action = string.Format("javascript:UmbClientMgr.contentFrame('/umbraco/NewsletterStudio/Pages/Subscription.aspx?id={0}');", subscription.Id);
tree.Add(node);
}
}
got some info from the chrome console? inspected the link to see the exact js attached to it?
I'm pretty sure its caused by you not using a tree function but the javascript:js() syntax tho
Hi! No information in the console - it just loads the dashboard. Hmm. the child nodes generated in the "Render" method above are clickable but not the rootnode. The code is basiclly the same:
(Don't work) rootNode.Action = string.Format("javascript:UmbClientMgr.contentFrame('/umbraco/NewsletterStudio/Pages/Settings.aspx');");
vs.
(Works) node.Action = string.Format("javascript:UmbClientMgr.contentFrame('/umbraco/NewsletterStudio/Pages/Subscription.aspx?id={0}');", subscription.Id);
PS. Let me know if you need remote access to the installation.
And no the link looks looks like this in both cases: Default
Ah, I needed to look at the error a couple of times to get why this didnt work. Its because you set an action on the root node of a tree, currently that action is not mapped over to the new trees, but it should, assigning this to shannon as he knows where that should happen
Okey, found the problem, which is because we strip out these javascript actions on root nodes, have now removed that clause in the code, fixed up a couple of methods, and things seems to work just fine.
Priority: Normal
Type: Bug
State: Fixed
Assignee: Shannon Deminick
Difficulty: Normal
Category:
Backwards Compatible: True
Fix Submitted:
Affected versions: 7.0.0
Due in version: 7.0.0
Sprint:
Story Points:
Cycle: