PortletURL setParameter does not replace value, it appendsduplicate value - Websphere

This is a discussion on PortletURL setParameter does not replace value, it appendsduplicate value - Websphere ; I am finding in my new Portal 6.1 install that JSR 168 portlets which use PortletURL objects, update a parameter using: setParameter("name","value"); do not replace the value. Instead they create a new parameter on the PortletURL object along with the ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: PortletURL setParameter does not replace value, it appendsduplicate value

  1. PortletURL setParameter does not replace value, it appendsduplicate value

    I am finding in my new Portal 6.1 install that JSR 168 portlets which
    use PortletURL objects, update a parameter using:
    setParameter("name","value");
    do not replace the value. Instead they create a new parameter on the
    PortletURL object along with the new value.
    For example:
    PortletURL p_url = response.createActionURL();
    p_url.setPortletMode(PortletMode.VIEW);
    p_url.setWindowState(WindowState.NORMAL);
    p_url.setParameter("firstname","Nathan");
    p_url.setParameter("firstname","Bob");
    The value of the parameter called 'firstname' is not being
    overwritten. Instead there is a second parameter being created called
    'firstname'.
    This code works fine on Portal 6.0, but as we're migrating to Portal
    6.1, we need to get this working as soon as possible.
    Because this is a bug, I have to now code around this to meet our go
    live deadline. Do IBM look at this group? If so, is there a way I can
    escalate this to get it fixed?
    Cheers,
    Nathan

  2. Re: PortletURL setParameter does not replace value, it appendsduplicate value

    On Jul 2, 5:52*pm, NATHAN.DU...@FLINTSHIRE.GOV.UK wrote:
    > I am finding in my new Portal 6.1 install that JSR 168 portlets which
    > use PortletURL objects, update a parameter using:
    > setParameter("name","value");
    > do not replace the value. Instead they create a new parameter on the
    > PortletURL object along with the new value.
    > For example:
    > PortletURL p_url = response.createActionURL();
    > p_url.setPortletMode(PortletMode.VIEW);
    > p_url.setWindowState(WindowState.NORMAL);
    > p_url.setParameter("firstname","Nathan");
    > p_url.setParameter("firstname","Bob");
    > The value of the parameter called 'firstname' is not being
    > overwritten. Instead there is a second parameter being created called
    > 'firstname'.
    > This code works fine on Portal 6.0, but as we're migrating to Portal
    > 6.1, we need to get this working as soon as possible.
    > Because this is a bug, I have to now code around this to meet our go
    > live deadline. Do IBM look at this group? If so, is there a way I can
    > escalate this to get it fixed?
    > Cheers,
    > Nathan


    Hi Nathan,

    Where and how are you getting these parameter values ?

    Regards,

    http://ExtremePortal.blogspot.com

  3. Re: PortletURL setParameter does not replace value, it appendsduplicate value

    On Jul 7, 7:55*am, Try_Catch_Finally wrote:
    > On Jul 2, 5:52*pm, NATHAN.DU...@FLINTSHIRE.GOV.UK wrote:
    >
    >
    >
    >
    >
    > > I am finding in my new Portal 6.1 install that JSR 168 portlets which
    > > use PortletURL objects, update a parameter using:
    > > setParameter("name","value");
    > > do not replace the value. Instead they create a new parameter on the
    > > PortletURL object along with the new value.
    > > For example:
    > > PortletURL p_url = response.createActionURL();
    > > p_url.setPortletMode(PortletMode.VIEW);
    > > p_url.setWindowState(WindowState.NORMAL);
    > > p_url.setParameter("firstname","Nathan");
    > > p_url.setParameter("firstname","Bob");
    > > The value of the parameter called 'firstname' is not being
    > > overwritten. Instead there is a second parameter being created called
    > > 'firstname'.
    > > This code works fine on Portal 6.0, but as we're migrating to Portal
    > > 6.1, we need to get this working as soon as possible.
    > > Because this is a bug, I have to now code around this to meet our go
    > > live deadline. Do IBM look at this group? If so, is there a way I can
    > > escalate this to get it fixed?
    > > Cheers,
    > > Nathan

    >
    > Hi Nathan,
    >
    > Where and how are you getting these parameter values ?
    >
    > Regards,
    > http://ExtremePortal.blogspot.com- Hide quoted text -
    >
    > - Show quoted text -


    Hi Neerja,
    I've managed to fix it by not using the same PortletURL object each
    time I was setting a parameter. Instead I created a new PortletURL
    object for each link, and called setParameter on it.

    This was being called in a calls I wrote, so by making it a new object
    each time, I got round the duplicating parameter problem.

    Cheers,
    Nathan

+ Reply to Thread