Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • halo224 13 posts 33 karma points
    May 13, 2011 @ 09:46
    halo224
    0

    Custom section and contextual menu

    Hi all, please i need your help

    Scenario:
    - custom section
    - 2 appTree under that section
    - on CreateRootNode for each Class I need to insert a custom contextual menu that implements umbraco.interfaces.IAction

    All works fine but... for each node is called the same class, why? where is my mistake?

    AppTree 1

    Public Class loadProductTags
        '...       

        Protected Overrides Sub CreateRootNode(ByRef rootNode As XmlTreeNode)
                rootNode.Icon = FolderIcon
                rootNode.OpenIcon = FolderIconOpen
                rootNode.NodeType = TreeAlias
                rootNode.NodeID = "init"
                rootNode.Menu.Insert(0, New SortActionProductTags())
                rootNode.Menu.Insert(1, umbraco.BusinessLogic.Actions.ContextMenuSeperator.Instance)
            End Sub
    '...
     End Class

    '...
     Public Class SortActionProductTags
    '...
            Implements umbraco.interfaces.IAction
    '...
     End Class

    AppTree 2

    Public Class loadReferenceTags
        '...       

        Protected Overrides Sub CreateRootNode(ByRef rootNode As XmlTreeNode)
                rootNode.Icon = FolderIcon
                rootNode.OpenIcon = FolderIconOpen
                rootNode.NodeType = TreeAlias
                rootNode.NodeID = "init"
                rootNode.Menu.Insert(0, New SortActionReferenceTags())
                rootNode.Menu.Insert(1, umbraco.BusinessLogic.Actions.ContextMenuSeperator.Instance)
            End Sub
    '...
     End Class

    '...
     Public Class SortActionReferenceTags
    '...
            Implements umbraco.interfaces.IAction
    '...
     End Class

    Is called always SortActionProductTags for every node. Only excluding it from the project, SortActionReferenceTags is loaded...
    I
    'm despairing.

    Really thanks
    max

  • Robert Foster 459 posts 1820 karma points MVP 2x admin c-trib
    May 14, 2011 @ 05:18
    Robert Foster
    0

    Hi Max,

    All of the Custom Actions are loaded regardless of whether you want them or not, and if you have the same "key" (that one character unique identifier), then only the first one with that key discovered will be able to be fired even though they are all loaded.  Juno will fix this by using Guids instead of the character key, as has been mentioned elsewhere in the forums.

    If you need further guidance, post the complete code for the custom actions...

Please Sign in or register to post replies

Write your reply to:

Draft