Javascript Error: Umbraco.Controls.TreePicker is undefined
I created a .Net User Control macro with public properties. One of those properties is a textMultiLine type. When I try to add the macro to my template I'm getting a javascript error "Umbraco.Controls.TreePicker is undefined". The Firefox error console is pointing me to this line in the umbraco/dialogs/editMacro.aspx page, line 41.
var picker = Umbraco.Controls.TreePicker.GetPickerById(controlId);
Does anyone know what could be causing this. One of the 4 Macros I created works fine. The other 3 all give me this error.
Rather than trying to pass parameters into the macro, I set the values I wanted to pass as parameters as properties of a page then pulled them the page properties. I created a Helper class with the methods below to check the Node tree for the property and return the value.
public class umbracoHelpers{ /// Does a recursive check up the node tree to find a property with the specified alias. /// If found it returns its value. /// If not found it returns an empty string. public static string getNodeValueRecursively(Node node, string alias) { string value = checkNodeForValue(node, alias); while (string.IsNullOrEmpty(value) && node.Parent != null) { node = node.Parent; value = umbracoHelpers.checkNodeForValue(node, alias); } return value; }
/// Checks the current node for a property with the /// specified alias and returns that properties value if found. /// Returns an empty string if the alias is not found. public static string checkNodeForValue(Node node, String alias) { string code = string.Empty; foreach (Property prop in node.Properties) { if (prop.Alias != alias) continue; code = prop.Value; break; } return code; } }
Javascript Error: Umbraco.Controls.TreePicker is undefined
I created a .Net User Control macro with public properties. One of those properties is a textMultiLine type. When I try to add the macro to my template I'm getting a javascript error "Umbraco.Controls.TreePicker is undefined". The Firefox error console is pointing me to this line in the umbraco/dialogs/editMacro.aspx page, line 41.
Does anyone know what could be causing this. One of the 4 Macros I created works fine. The other 3 all give me this error.
Help please.
Did you ever get a fix for this? I am getting the same issue with Umbraco 4.7 on Firefox 4
No, I found a work around.
Rather than trying to pass parameters into the macro, I set the values I wanted to pass as parameters as properties of a page then pulled them the page properties. I created a Helper class with the methods below to check the Node tree for the property and return the value.
I hope this helps you.
is working on a reply...