cancel
Showing results for 
Search instead for 
Did you mean: 

Expand folders in Detail Navigation by default

Former Member
0 Kudos

Has anyone figured out a way to have the folders in details navigation expanded by default the first time the user clicks on the tab?

I tried this:

But it didn't work for me. I have seen other claims that it can be set desktop wide, but no solution.

Any help would be much appreciated.

Clark

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Archer,

Please go through the solution discussed in the thread below:

[]

Sorry didn't see this thread, apologies for posting the reply twice.

Hope it helps,

Prathamesh

Former Member
0 Kudos

Prathamesh,

First of all thanks so much for your suggestion. It would have worked perfectly if I was using the lightweight version of the detail navigation. But is did lead me to download the code for the detail navigation tree par file and I found some interesting things.

First of all this should work by changing a parameter on the iview according to the code I found. See the code below (particularly the set state line).



    private void openFolder(IPortalComponentRequest request, HashMap dropJScriptsMap, ITree tree, INavigationNode node, ITreeNode treeNode)
    {
        if(treeNode == null)
            return;
        IPortalComponentContext componentContext = request.getComponentContext();
        IPortalComponentProfile profile = componentContext.getProfile();
        Boolean leafNode = null;
        try
        {
            leafNode = (Boolean)node.getAttributeValue("com.sap.portal.navigation.IsLeaf");
            if(leafNode == null)
                leafNode = Boolean.FALSE;
        }
        catch(NoSuchAttributeException ex)
        {
            leafNode = Boolean.FALSE;
        }
        String openFolder = profile.getProperty("com.sap.portal.navigation.detailedtree.openfolder");
        if(openFolder.equals("true") && leafNode != Boolean.TRUE)
        {
            treeNode.setState("o");
            addNavNodeChildrenToTree(request, tree, node, dropJScriptsMap, true);
        }
    }

But it only looks to work if the folder is at the top level. Otherwise it rights children as closed. See the line for setState in method addNavigationNodesToTree.



            if(newNode.getVisualizationType() == 2)
            {
                if(parentNode != null)
                    treeNode = tree.addNode(nodeName, title, "F", parentNode);
                else
                    treeNode = tree.addRoot(nodeName, title, "F");
                treeNode.setState("c");
                treeNode.setFolderOpenImage(mm_folderImageUrl);
                treeNode.setFolderCloseImage(mm_folderImageUrl);
            } else
            {

So I really have 2 options. I can redeploy new code with the line just above changed (I didn't plan on modifying the SAP delivered), or I can move my nodes up to a higher level and change the parameters on the iview.

I hope others might find this useful and perhaps SAP will adopt another iview parameter in the future to completely allow for this as it seems pretty trivial.

Thanks again.

ACD