Re: Create a drop down menu across the top of a page - Websphere

This is a discussion on Re: Create a drop down menu across the top of a page - Websphere ; HI, How do we pass render parameter to portal page URL ? In static approach: In dynamic approach: ???. In below , how do we attach the param? String refUrl = wpsNavModelUtil.createSelectionChangeURL(wpsNavNod e); Advance thanks....

+ Reply to Thread
Results 1 to 2 of 2

Thread: Re: Create a drop down menu across the top of a page

  1. Re: Create a drop down menu across the top of a page

    HI,



    How do we pass render parameter to portal page URL ?



    In static approach:





    In dynamic approach: ???. In below , how do we attach the param?

    String refUrl = wpsNavModelUtil.createSelectionChangeURL(wpsNavNod e);


    Advance thanks.

  2. Re: Create a drop down menu across the top of a page

    if you want to use the url generation api, then you can pass in whatever string you want

    do something like this

    // Get the URL factory

    URLFactory urlFactory = mgr.getURLFactory();

    final EngineURL url ;

    if(saveState) {

    url = urlFactory.newURL(Constants.SMART_COPY);

    } else {

    url = urlFactory.newURL(Constants.EMPTY_COPY);

    }

    try {

    // Set the page this URL should point to



    final com.ibm.portal.state.accessors.selection.Selection AccessorFactory selectionFactory = (com.ibm.portal.state.accessors.selection.Selectio nAccessorFactory) mgr.getAccessorFactory(com.ibm.portal.state.access ors.selection.SelectionAccessorFactory.class);

    // Request the selection controller to set the page; pass in the state associated with the created URL

    final SelectionAccessorController selectionCtrl = selectionFactory.getSelectionAccessorController(ur l.getState());

    // Set the page; you need the unique name (String) or the ObjectID of that page

    selectionCtrl.setSelection(pageName);

    // Dispose the accessor (avoids memory leak)

    selectionCtrl.dispose();

    if(portletName != null) {

    // Set portlet render parameters

    final PortletAccessorFactory portletAccessorFactory = (PortletAccessorFactory) mgr.getAccessorFactory(PortletAccessorFactory.clas s);



    // Get the portlet controller to set render parameters; pass in the state associated with rge created URL

    final PortletAccessorController portletCtrl = portletAccessorFactory.getPortletAccessorControlle r(portletName, url.getState());



    if (portletModeName != null) {

    PortletMode portletMode = new PortletMode(portletModeName);

    portletCtrl.setPortletMode(portletMode);

    }

    // Set the render parameter

    if(params != null) {

    portletCtrl.getParameters().putAll(params);

    }

    // Dispose the accessor (avoids memory leak)

    portletCtrl.dispose();

    }

    finalUrl = url.writeDispose(new StringWriter()).toString();

    } finally {

    urlFactory.dispose();

    }



    // Now convert the URL to a String; pass in your writer.

    // writeDispose() writes the URL to the given writer and disposes the URL afterwards.

    // If you want to display this URL a multiple times pls use writeCopy().

    return finalUrl;





    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

+ Reply to Thread