Clarity

  • 1.  Link paramter

    Posted Feb 10, 2015 05:43 PM


    Hi Freinds,

     

    We have a link between two portlets. A link parmeter is used which will take value( based on user click) from first portlet and the second portlet will be filtered based on this value. After the first use of this link paramter, we would like to clear the value of this link parameter so that the second portlet will work based on its own filter values. Is anyone has any suggestion in doing so?

     

     

    What we want to achieve

    ---

    Step 1: From portlet1, user click on link(say department), the user will be redirected to portlet2 and this portlet will be filtered based on values of link parameter. -- This is working as expected

    Step2: Portlet2 has its own filter option(to fitler for different department or for all department). This filter is not getting applied since the link parameter value is not getting cleared.

     

     

     

    Thanks in advance.

    Sreelesh



  • 2.  Re: Link paramter

    Posted Feb 11, 2015 03:18 AM

    The way that "link parameters" work is by providing the parameter on the URL of the portlet-page that we link to.  Therefore, if your NSQL code in "Portlet2" always picks up that parameter from the page URL then that parameter is never "cleared".

     

    So there is no simple answer to your question.... you could;

     

    1) have another copy of the portlet on a different portlet-page - get the user to use that when they want to use alternative parameters

    2) train the user to edit the URL, removing the link parameter from it

    3) code your NSQL in'portlet 2' to ignore the URL parameter if any normal filters have been used (this would require that all your normal filters in 'portlet 2' would be coded as WHERE:PARAM filters rather than automatic ones).

     

    Option 1 is the easiest (and what I would do), option 3 could be "seamless" from a user point of view, but its a rather over-complicated solution I feel.



  • 3.  Re: Link paramter

    Posted Feb 11, 2015 09:39 AM


    Thanks David for your thought.

     

    I actually implemented option 3. But problem is

    1. We are not able to give "multi select" option in the filter in portlet2 (when multi option is enabled, the parameter value will be taken as NULL)

    2. If user click "show all" in second portlet filter, it will considered as NULL for that filter and will get filtered based on link paramter from portlet 1.

     

    I know this is tricky, but wish if there is a way!!!

     

    Regards,

    Sreelesh



  • 4.  Re: Link paramter
    Best Answer

    Posted Feb 11, 2015 09:57 AM

    You can suppress "Show All" by making a filter mandatory - so perhaps make a dummy filter field, provide a dummy value and then hide it from the users.

     

    I can't briefly get into the complications around user-defined multi-select filters (there is some discussion on these boards around that - it gets messy though), but I suspect that the "option 3" would make those not work either - (i.e. I am agreeing with you here).

     

    Option 1 is the way!



  • 5.  Re: Link paramter

    Posted Feb 11, 2015 10:20 AM

    Thanks David. Your quick response is much appreciated.