Skip to Content

Navigation Links in Combo Box

In Internet terminology, this type of navigation is called “Quick Links”. I will also use the term “Quick Links”. It is completely different from the “Quick Links” in SAP terminology.

Quick Links
are used often in web sites especially if you have complex navigation
structure.Instead of going through the navigation steps you can easily
select your navigation target from combo box. In this weblog, I will
explain the implementation steps for Quick Links.


At the end of this blog we will have a quick link menu like :


Let’s Start

    • Open
      Netweaver Developer Studio in Enterprise Portal perspective.
    • Create
      a new “Portal Application Project”
    • Create
      a package “com.utility” in folder
The project structure should
look like  :


    1. Create
      a class “QuickLinks”  ( superclass :
      AbstractPortalComponent )

package com.utility;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Locale;

import com.sapportals.portal.navigation.INavigationNode;
import com.sapportals.portal.navigation.INavigationService;
import com.sapportals.portal.navigation.NavigationNodes;
import com.sapportals.portal.prt.component.AbstractPortalComponent;
import com.sapportals.portal.prt.component.IPortalComponentContext;
import com.sapportals.portal.prt.component.IPortalComponentInitContext;
import com.sapportals.portal.prt.component.IPortalComponentProfile;
import com.sapportals.portal.prt.component.IPortalComponentRequest;
import com.sapportals.portal.prt.component.IPortalComponentResponse;
import com.sapportals.portal.prt.component.PortalComponentException;
import com.sapportals.portal.prt.runtime.PortalRuntime;


  • Created on 03.Mar.2007



  • @author Abdulbasit Gulsen

public class QuickLinks extends AbstractPortalComponent {


     String output;
     int maxdepth;     
     public QuickLinks() {
          // TODO Auto-generated constructor stub

     /* (non-Javadoc)

  • @see com.sapportals.portal.prt.component.AbstractPortalComponent#doContent(com.sapportals.portal.prt.component.IPortalComponentRequest, com.sapportals.portal.prt.component.IPortalComponentResponse)

     protected void doContent(
          IPortalComponentRequest request,
          IPortalComponentResponse response) {
          // TODO Auto-generated method stub
          IPortalComponentContext componentContext = request.getComponentContext();
          IPortalComponentProfile profile = componentContext.getProfile();
          maxdepth = Integer.parseInt(profile.getProperty(“depth”));
          int depth = 0;
          output = “”;                                                  
          Locale lcl = request.getLocale();     
          String strLocale = lcl.toString();     
          output += “<style>”;
          output += “select.list {“;
          output += “font-size : 9px;”;
          output += “}</style>”;
          output += “”;
          output += “<form  name=\”navigation\”>”;
          output += “<select name=\”links\” class=\”list\” onchange=\”javascript:window.location.href = document.navigation.links.options[document.navigation.links.selectedIndex].value;\”>”;                                   
          if (strLocale.equals(“tr”))               
               output += “<option selected>Hýzlý Eriþim</option>”;
               output += “<option selected>Quýck Links</option>”;
          try {
          NavigationNodes rootNodes = getrootnodes(request);
          int i = 1;
          for(Iterator it = rootNodes.iterator(); it.hasNext();){
               INavigationNode rootNode = (INavigationNode);
               String title =  rootNode.getTitle(lcl);               
               output += “<option value=\”/irj/portal/anonymous?NavigationTarget=” + rootNode.getName() + “\”>” + title + “</option>”;               
               i = i + 1;
          } catch (Exception e) {}         
          output += “</select>

     /* (non-Javadoc)

  • @see com.sapportals.portal.prt.component.IPortalComponentInit#init(com.sapportals.portal.prt.component.IPortalComponentInitContext)

     public void init(IPortalComponentInitContext arg0)
          throws PortalComponentException {
          // TODO Auto-generated method stub
     private void getRestofNodes(INavigationNode rootnode,
                                 Locale lcl,
                                 int depth) throws Exception
     if (depth>=maxdepth&&maxdepth!=0) {
     String filler =””;
     for (int i=0;i

Hint : If you don’t want to go into deep navigation structures change depth property in IView properties.

If you put 0 you will get whole navigation structure.

You must be Logged on to comment or reply to a post.
  • Nice blog, and I will reference it from the Portal Wiki.

    One note: Be careful in calling this “Quick Links”, as the portal has a Quick Links feature and it was confusing, since I assumed that you were somehow creating these quick links in some automated way.

    In any event, nice blog.


    • Hi Daniel,

      I was also afraid of confusion with the term “Quick Links” when writing the blog. However, in Internet terminology, “Quick Links” means links in combo box. However, in SAP terminology it is completely different. I couldn’t find a more suitable word other than “Quick Links”..
      Anyway, I will change the title to prevent confusions..