Show TOC

Triggering NavigationLocate this document in the navigation structure

Use

The following describes the methods for creating links to other navigation nodes:

  • Navigation Tag Library (JSP)

    The navigation tag library provides access to navigation nodes and can create navigation links from them.

    For example, the following exposes the navigation node ROLES://portal_content/myRole/myIView and creates a link for navigating to the node:

                      <nav:navNode navTarget="ROLES://portal_content/myRole/myIView">
        <nav:navNodeAnchor navigationMethod="byURL"
            urlParameters="<%=urlParameters%>"
            anchorAttributes="class=\"myCSSstyle\""/>
    </nav:navNode>
    
                   

    The tag library is for portal components built from a JSP page.

    For more information, see Navigation Tag Library .

  • Client-Side Eventing (EPCM)

    The portal's client-side eventing mechanism (EPCM) provides a JavaScript function for navigating to a specific navigation node.

    The following creates a link for navigating to the ROLES://portal_content/myRole/myIView node:

                      <a href="#"
    onclick="EPCM.doNavigate('ROLES://portal_content/myRole/myIView');
    return false;"> 
        This is an HTML link
    </a> 
    
                   

    For more information, see Enterprise Portal Client Framework (EPCF)

    Instead of writing the code for the EPCM.doNavigate call, you can get the code by calling NavigationEventsHelper.addClickEvent() , which creates the code and stores it as a StringBuffer in one of the function's parameter, as shown in the following:

                      import com.sapportals.htmlb.Link;
    import com.sapportals.portal.navigation.NavigationEventsHelper;;
    import com.sapportals.portal.navigation.NavigationEventsHelperService;
     
    NavigationEventsHelperService service = (NavigationEventsHelperService)
        PortalRuntime.getRuntimeResources().getService(
        NavigationEventsHelperService.KEY);
     
    NavigationEventsHelper helper =
        service.getNavigationEventsHelperInstance();
     
    INavigationNode currNode = service.getCurrentContextNavNode(request);                   
     
    Link titleLink = new Link(
        currNode.getName(), currNode.getTitle(request.getLocale()));
     
    StringBuffer scriptTarget = new StringBuffer();
     
    helper.addClickEvent(
        currNode, scriptTarget, request, false, null);
     
    titleLink.setReference("javascript:void(0)");
    titleLink.setOnClientClick(scriptTarget.toString());
    titleLink.setLinkDesign(LinkDesign.DRAGRELATE);
    
                   
  • Portal Runtime Link (PRT)

    You can create a link to a specific portal component instead of to a node in the navigation hierarchy. Use the PRT API to create a link, as follows:

                      IPortalComponentURI componentURI = request.createPortalComponentURI();
    componentURI.setContextName("myApplication.myComponent");
    myUrl = componentURI.toString();
    
                   

    Embed the myURL string in an HTML anchor tag.

    For more information on this API, see Request URL .