|
Home > Archive > WebSphere Portal Server > June 2004 > Method addParameter of PortletURI
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Method addParameter of PortletURI
|
|
| Priamikov Alexei 2004-06-17, 5:52 pm |
| Hello I'm fresh in this forum, nice to meet u here.
I'm developing portlet application in WSAD (v 5.0.1)
and I've got a following problem:
I need to add array of String-parameters to URI (array of checkbox) but I
didn't find a method that allows me to do it.
I've found the sort of decision on:
http://www.bluesunrise.com/portlet-...PortletURL.html
setParameter(java.lang.String name, java.lang.String[] values)
Sets the given String array parameter to this URL.
but there is no such method in org.apache.jetspeed.portlet in interface
PortletURI
method addParameter adds to URI only one parameter (the last).
Has anyone decision of such problem? I'll be very appreciate.
| |
|
| "Priamikov Alexei" <apriam@novsu.ac.ru> wrote in message news:<cas6ma$7b2m$1@news.boulder.ibm.com>...
Use the PortletURI addParameter method.
Steve
> Hello I'm fresh in this forum, nice to meet u here.
>
> I'm developing portlet application in WSAD (v 5.0.1)
> and I've got a following problem:
>
> I need to add array of String-parameters to URI (array of checkbox) but I
> didn't find a method that allows me to do it.
> I've found the sort of decision on:
> http://www.bluesunrise.com/portlet-...PortletURL.html
>
> setParameter(java.lang.String name, java.lang.String[] values)
> Sets the given String array parameter to this URL.
>
> but there is no such method in org.apache.jetspeed.portlet in interface
> PortletURI
> method addParameter adds to URI only one parameter (the last).
>
> Has anyone decision of such problem? I'll be very appreciate.
| |
| Priamikov Alexei 2004-06-24, 5:57 pm |
| Steve I know that method, I've already tried it, let me show:
addParameter adds one pair (parameter name and parameter value)
for example:
public String getURI (String[] EdLevID, String EdCatID, PortletResponse
response) {
PortletURI actionURI = response.createURI();
if ((EdCatID != null) || (EdCatID.length()!=0)) {
actionURI.addParameter("EducationNavigatorPortlet.EdCatID", EdCatID);
}
if ((EdAudID != null) || (EdAudID.length!=0)) {
for (int i=0; i<EdAudID.length; i++)
actionURI.addParameter("EducationNavigatorPortlet.EdAudID[]",
EdAudID[i]);
}
return actionURI.toString();
}
Problem is: in response will be written parameter
EducationNavigatorPortlet.EdCatID and only one parameter
lEducationNavigatorPortlet.EdAudID[] with last value of array, but I need to
write all values of array.
"steve" <> wrote in message
news:832620b7.0406210351.42b2a955@posting.google.com...
> "Priamikov Alexei" <> wrote in message
news:<cas6ma$7b2m$1@news.boulder.ibm.com>...[vbcol=seagreen]
>
> Use the PortletURI addParameter method.
>
> Steve
I[vbcol=seagreen]
values)[vbcol=seagreen]
| |
| Michael Harris 2004-06-29, 11:15 am |
| You will need to use separate parameter names for each element in the
array...
for (int i=0; i<EdAudID.length; i++) {
actionURI.addParameter("MyKey_"+i, EdAudID[i]);
}
And then re-construct the array in your action performed.
|
|
|
|
|