Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Lionel Griache
[RESOLVED] Can I use a "search-iterator" in the config page of a portlet?
September 18, 2008 7:18 AM
Answer

Lionel Griache

Rank: New Member

Posts: 16

Join Date: April 24, 2008

Recent Posts

Hi,

I am trying to use the tag "<liferay-ui:search-iterator>" in the configuration page of my portlet (configuration.jsp).
The problem is when creating the SearchContainer attached to it.
In any other JSP page, I usually handle the navigation by adding a parameter like this:

1    PortletURL portletURL = renderResponse.createRenderURL();
2    portletURL.setParameter("struts_action", "/ext/my_portlet/my_page");
3     .....
4    SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, "cur1",
5        SearchContainer.DEFAULT_DELTA, portletURL, headerNames, "No row");


This works just fine..except when I try this on the configuration page of a portlet.
I tried the following:
1    portletURL.setParameter("struts_action", "/ext/my_portlet/configuration");

...and making sure the path "/ext/my_portlet/configuration" is defined and points to configuration.jsp in both "struts-config.xml" and "tiles-defs.xml" but I then get the following error message:
"The struts path ext/kpi_array does not belong to portlet 86. Check the definition in liferay-portlet.xml"

In my file liferay-portlet.xml, I have the following:
<configuration-action-class>com.ext.portlet.my_portlet.action.ConfigurationActionImpl</configuration-action-class>

Any suggestion on how to make this work?

Thanks.
Lionel Griache
RE: Can I use a "search-iterator" in the configuration page
September 18, 2008 7:17 AM
Answer

Lionel Griache

Rank: New Member

Posts: 16

Join Date: April 24, 2008

Recent Posts

Ok. I think I found the solution, by looking at some other examples...
Here's the code that works:

 1
 2String portletResource = ParamUtil.getString(request, "portletResource");
 3String modelResource = ParamUtil.getString(request, "modelResource");
 4String modelResourceDescription = ParamUtil.getString(request, "modelResourceDescription");
 5String resourcePrimKey = ParamUtil.getString(request, "resourcePrimKey");
 6
 7....
 8
 9PortletURL portletURL = renderResponse.createRenderURL();
10
11portletURL.setParameter("struts_action", "/portlet_configuration/edit_configuration");
12portletURL.setParameter("portletResource", portletResource);
13portletURL.setParameter("modelResource", modelResource);
14portletURL.setParameter("modelResourceDescription", modelResourceDescription);
15portletURL.setParameter("resourcePrimKey", resourcePrimKey);
16
17...
18
19SearchContainer searchContainer = new SearchContainer(renderRequest, null, null, "cur1",
20        SearchContainer.DEFAULT_DELTA, portletURL, headerNames, "No row");
21...
Juan Fernández
RE: Can I use a "search-iterator" in the configuration page
January 27, 2009 8:54 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

Thanks!
It was useful
Juan Fernández