Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
<liferay-ui:search-container /> tag issue in liferay config mode Prakash Khanchandani April 26, 2011 5:04 AM
RE: <liferay-ui:search-container /> tag issue in liferay config mode Prakash Khanchandani April 26, 2011 11:48 PM
RE: <liferay-ui:search-container /> tag issue in liferay config mode Jitendra Rajput April 27, 2011 3:25 AM
RE: <liferay-ui:search-container /> tag issue in liferay config mode Prakash Khanchandani April 27, 2011 10:13 PM
RE: <liferay-ui:search-container /> tag issue in liferay config mode Nilesh Gundecha April 28, 2011 12:29 AM
RE: <liferay-ui:search-container /> tag issue in liferay config mode Prakash Khanchandani April 28, 2011 3:02 AM
RE: <liferay-ui:search-container /> tag issue in liferay config mode Akash Mohan Patil April 28, 2011 6:00 AM
RE: <liferay-ui:search-container /> tag issue in liferay config mode Akash Mohan Patil April 28, 2011 6:42 AM
RE: <liferay-ui:search-container /> tag issue in liferay config mode Nilesh Gundecha April 28, 2011 7:06 AM
RE: <liferay-ui:search-container /> tag issue in liferay config mode Prakash Khanchandani April 28, 2011 7:42 AM
RE: <liferay-ui:search-container /> tag issue in liferay config mode Akash Mohan Patil April 30, 2011 12:52 AM
RE: <liferay-ui:search-container /> tag issue in liferay config mode Rohit Salecha April 29, 2011 2:45 AM
RE: <liferay-ui:search-container /> tag issue in liferay config mode anil s kolhe August 16, 2012 7:21 AM
RE: <liferay-ui:search-container /> tag issue in liferay config mode Pinkesh Gandhi August 16, 2012 7:25 AM
RE: <liferay-ui:search-container /> tag issue in liferay config mode anil s kolhe August 16, 2012 11:01 PM
RE: <liferay-ui:search-container /> tag issue in liferay config mode anil s kolhe August 16, 2012 6:58 AM
RE: <liferay-ui:search-container /> tag issue in liferay config mode Prakash Khanchandani August 21, 2012 12:19 AM
RE: <liferay-ui:search-container /> tag issue in liferay config mode Jay Trivedi November 29, 2012 10:46 PM
RE: <liferay-ui:search-container /> tag issue in liferay config mode Prakash Khanchandani December 11, 2012 11:51 PM
Prakash Khanchandani
<liferay-ui:search-container /> tag issue in liferay config mode
April 26, 2011 5:04 AM
Answer

Prakash Khanchandani

Rank: Expert

Posts: 329

Join Date: February 10, 2011

Recent Posts

Hi,

I am developing a custom portlet and am using liferay configuration mode to add, update and search for entities.

Liferay configuration mode means I have defined <configuration-action-class> in my liferay-portlet.xml

I just want to display the number of entities (5 items/page) in the configuration.jsp. I am getting all the entities as a list in the request attribute and displaying using <liferay-ui:search-container> tag. The first page is displayed and when I click on next link or click on last link or select the items/page drop-down, the page becomes blank and I get a logger message as:
"11:08:06,031 ERROR [PortletRequestProcessor:402] 86 does not have any paths specified"

I have tried giving an iteratorURL for the tag, but still the same message.

If I move my code to the edit.jsp i.e. to the page called by my portlet class's doEdit method, the tag works perfectly fine. All the links and drop-down for pagination work just fine.

Only with the configuration.jsp there seems to be a problem.

I have also searched all the liferay portlets, only one of the portlets - Web Content Display has a search in the configuration mode, but the source code (the different search jsps and configuration.jsp in journal-content folder) reveals that it does not use the <liferay-ui:search-container> tag at all. It implements all the logic in the scriptlet itself.

Is it a bug or issue that the <liferay-ui:search-container> tag generate URLs does not work in liferay configuration mode.

I would be very thankful if anybody can help. Even if somebody can give a clue or something as to the implementation. Not asking more but if somebody can provide a bare-bones example of the same then it would be great.

Thanks once again

Regards,
Prakash
Prakash Khanchandani
RE: <liferay-ui:search-container /> tag issue in liferay config mode
April 26, 2011 11:48 PM
Answer

Prakash Khanchandani

Rank: Expert

Posts: 329

Join Date: February 10, 2011

Recent Posts

Anyone out there with any ideas, if we can directly use the <liferay-ui:search-container /> tag in the configuration.jsp?

I am trying to implement the same logic as used for searching journal article in the Webcontent Display portlet.

Here are some of the important source code files in the Webcontent display Portlet, which might give anybody facing the same problem a hint:
1) /html/portlet/journal_content/configuration.jsp
2) /html/portlet/journal/article_search_results.jspf
3) /html/portlet/journal/article_search.jsp
4) com.liferay.portlet.journal.search.ArticleSearchTerms
5) com.liferay.portlet.journal.search.ArticleDisplayTerms
6) com.liferay.portlet.journal.service.impl.JournalArticleLocalServiceImpl (search and searchCount methods in this class)

I will try to put my sample portlet here, if it works.

And if these hints somehow work for you, if possible please attach your portlet.

Again, please tell me if I am going on the right track or is there a easy way out, anyone?

Thanks for reading this far.
Jitendra Rajput
RE: <liferay-ui:search-container /> tag issue in liferay config mode
April 27, 2011 3:25 AM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 873

Join Date: January 7, 2011

Recent Posts

Hey i am not sure about your problem. but same thing i did in my project.

set your list in session or request inside doView() method not in processAction or any other.
so when ever you do any thing with search container it will like again call doView() and set the list so it will be available to search container.
Prakash Khanchandani
RE: <liferay-ui:search-container /> tag issue in liferay config mode
April 27, 2011 10:13 PM
Answer

Prakash Khanchandani

Rank: Expert

Posts: 329

Join Date: February 10, 2011

Recent Posts

Hi Jitendra,

The doView() method of the portlet does not get called, as a matter of fact none of the methods of the my Portlet class will get called if you are in the Liferay Config mode, the methods processAction() and render() of your ConfigurationActionImpl class will get called, and I think since the <liferay-ui:search-container /> tag's default implementation method tries to call the doView() it does not find it in my ConfigurationActionImpl class and hence the ERROR message.

Anyways I have sort of got the tag to work from my configuration.jsp with the use of a CustomSearchContainer class, I got many hints from the Journal module classes as mentioned in my previous post.

Thanks for the reply emoticon
Nilesh Gundecha
RE: <liferay-ui:search-container /> tag issue in liferay config mode
April 28, 2011 12:29 AM
Answer

Nilesh Gundecha

Rank: Regular Member

Posts: 196

Join Date: November 30, 2009

Recent Posts

Hi Prakash,

I want to implement pagination in my portlet, but am struggling achieving it.

I have the list of models which are embedded in the block as below-

 1
 2<% List<SomeModel> modelList = SomeModelService.getModels();
 3for(SomeModel model:modelList){
 4%>
 5
 6
 7<aui:layout cssClass="custom_block">
 8
 9<!--
10Inside this, there is combination of some text, images, href with respect to [b][i]SomeModel[/i][/b]..
11-->
12
13</aui:layout>
14
15
16<%
17}
18%>


I tried doing this using liferay searchContainer, Alloy Pagination but could not achieve it.

The problem I am facing in Search Container is as below : -

1
2<liferay-ui:search-container-row modelVar="...." className="...." >
3</liferay-ui:search-container-row>


So, am unable to understand how am I suppose to put my <aui:layout ...> in the <liferay-ui:search-container-row ..>. I dont want to disturb my designed <aui:layout ...>.

So, plz suggest whether this is possible to do using liferay searchConatiner?? If not, whats the other way to achieve this in liferay??

Any help would be highly appreciated.

Thanks and Regards,

Nilesh.
Aikon Labs Pvt. Ltd.,
India.
Prakash Khanchandani
RE: <liferay-ui:search-container /> tag issue in liferay config mode
April 28, 2011 3:02 AM
Answer

Prakash Khanchandani

Rank: Expert

Posts: 329

Join Date: February 10, 2011

Recent Posts

Hi Nilesh,

If I have understood the problem, the below solution should work.

You can have your layout defined in another jsp and embed the jsp in the searchContainer as follows:

 1<liferay-ui:search-container
 2        delta="5"
 3        emptyResultsMessage="there-are-no-models">
 4   
 5    <liferay-ui:search-container-results
 6            results="<%=modelList %>"
 7            total="<%=modelList.size %>" />
 8
 9    <liferay-ui:search-container-row
10            className="com.your.model.SomeModel"
11            keyProperty="modelId"
12            modelVar="someModel">
13
14
15    <liferay-ui:search-container-column-jsp path="/html/your/folder/model_layout.jsp" />
16            
17    </liferay-ui:search-container-row>
18   
19    <liferay-ui:search-iterator />
20
21</liferay-ui:search-container>


and in the model_layout.jsp you can have your layout:

 1<%@page import="com.liferay.portal.kernel.dao.search.ResultRow"%>
 2<%
 3    ResultRow row = (ResultRow)request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
 4    SomeModel model = (SomeModel )row.getObject();
 5%>
 6
 7<aui:layout cssClass="modelCssClass">
 8
 9  <b> This is my Layout</b>
10  Name: <%= model .getModelName() %><br />
11  Description: <%= model .getModelDescription() %> <br />
12
13</aui:layout>


The pagination will be taken care by the searchContainer tag if the results and total are set correctly.

Hope it helps emoticon
Akash Mohan Patil
RE: <liferay-ui:search-container /> tag issue in liferay config mode
April 28, 2011 6:00 AM
Answer

Akash Mohan Patil

Rank: Junior Member

Posts: 70

Join Date: December 12, 2010

Recent Posts

hey Prakash Khanchandani ,
Thank you very much for your code., it is working well. but i am facing a small problems.,
i used your code, as you mentioned., i am getting the paginoator well.,



and the functionality is also good. but the top of this paginator it is showing all the results which are in list.,

please can u find wher i am doing mistake., i used your code as it is. ,
i have some doubts.,
1    
2<liferay-ui:search-container-results
3results="<%= someList%>"
4total="<%= someList.size %>" />

as i think someList you have declared befor this n size is the size of that list.

please help me to get out from this problem.

Thank you,
Akash Patil
Akash Mohan Patil
RE: <liferay-ui:search-container /> tag issue in liferay config mode
April 28, 2011 6:42 AM
Answer

Akash Mohan Patil

Rank: Junior Member

Posts: 70

Join Date: December 12, 2010

Recent Posts

Hey i got the solution. , the prob was simple.,
1
2
3     <liferay-ui:search-container-results
4results="<%=ListUtil.subList(someList,searchContainer.getStart(),searchContainer.getEnd())%>"
5             total="<%= someList.size() %>" />


just result attribute we have to change .
any how thanks for both.,

Regards ,
Akash patil
Nilesh Gundecha
RE: <liferay-ui:search-container /> tag issue in liferay config mode
April 28, 2011 7:06 AM
Answer

Nilesh Gundecha

Rank: Regular Member

Posts: 196

Join Date: November 30, 2009

Recent Posts

Hi Prakash,

Thanks a lot for your wonderful explanation. It really helped us and ended out 2 long days struggle.

Regards,
Nilesh.
Prakash Khanchandani
RE: <liferay-ui:search-container /> tag issue in liferay config mode
April 28, 2011 7:42 AM
Answer

Prakash Khanchandani

Rank: Expert

Posts: 329

Join Date: February 10, 2011

Recent Posts

Hi Nilesh,

Good it worked for you emoticon

Regards,
Prakash
Rohit Salecha
RE: <liferay-ui:search-container /> tag issue in liferay config mode
April 29, 2011 2:45 AM
Answer

Rohit Salecha

Rank: Junior Member

Posts: 50

Join Date: February 20, 2011

Recent Posts

Liferay Search Container

http://liferaydemystified.blogspot.com/search/label/Liferay%20Search%20Container
Akash Mohan Patil
RE: <liferay-ui:search-container /> tag issue in liferay config mode
April 30, 2011 12:52 AM
Answer

Akash Mohan Patil

Rank: Junior Member

Posts: 70

Join Date: December 12, 2010

Recent Posts

Hi Prakash,

I am facing problem in liferay tabs & liferay search container,
Basically I am having two tabs, under which I am having liferay Search pagination code.

This is my code for displaying tabs: -

 1
 2<%PortletURL portletURL = renderResponse.createRenderURL();    %>
 3
 4    <liferay-ui:tabs
 5    names="sample1,sample2,"
 6    refresh="true"
 7    param="tabs1"
 8    url="<%=portletURL.toString() %>"
 9    >


And the sections are as follows. And in both the sections, I have used liferay search container for two different lists by implementing pagination using search container.

 1
 2<liferay-ui:section >
 3<liferay-ui:search-container
 4                 delta="5"
 5                 emptyResultsMessage="there-are-no-data">
 6            
 7             <liferay-ui:search-container-results
 8                     results="someList"
 9                     total="<%= someList.size() %>" />
10         
11             <liferay-ui:search-container-row
12                    className="com.model.someModel"
13                    keyProperty="someId"
14                    modelVar="someModel">
15            <liferay-ui:search-container-column-jsp path="/html/common//some.jsp" />            
16            </liferay-ui:search-container-row>
17            <liferay-ui:search-iterator />
18        </liferay-ui:search-container>
19
20</liferay-ui:section >
21<liferay-ui:section >
22<liferay-ui:search-container
23                 delta="5"
24                 emptyResultsMessage="there-are-no-data">
25            
26             <liferay-ui:search-container-results
27                     results="someOtherList"
28                     total="<%= someOtherList.size() %>" />
29         
30             <liferay-ui:search-container-row
31                    className="com.model.someModel"
32                    keyProperty="someId"
33                    modelVar="someModel">
34            <liferay-ui:search-container-column-jsp path="/html/common//some.jsp" />            
35            </liferay-ui:search-container-row>
36            <liferay-ui:search-iterator />
37        </liferay-ui:search-container>
38
39</liferay-ui:section >


And here is the end tag for tabs -
1
2</liferay-ui:tabs >



The problem I am facing is in remembering the current tab. When I am on my second tab, and the paginated list under it is long enough and I click next(on pagination board) to see the paginated items, the entire portlets seems to be getting reloaded, which takes me to my first tab (instead of keeping the focus on second tab).

How can we persist the selectedTab value even after the reloading of the page. Or is there any way where I can switch it off the reloading of page when clicking on the "Next" button of paginator.

Please help me to solve this problem. Struggling on this since long time.


Thank you all,
Akash Patil.
anil s kolhe
RE: <liferay-ui:search-container /> tag issue in liferay config mode
August 16, 2012 6:58 AM
Answer

anil s kolhe

Rank: New Member

Posts: 22

Join Date: March 11, 2009

Recent Posts

Hi Prakash,
Please post the solution which you have used to make search container in config mode.

Thanks
Anil
anil s kolhe
RE: <liferay-ui:search-container /> tag issue in liferay config mode
August 16, 2012 7:21 AM
Answer

anil s kolhe

Rank: New Member

Posts: 22

Join Date: March 11, 2009

Recent Posts

Prakash Khanchandani:

Anyways I have sort of got the tag to work from my configuration.jsp with the use of a CustomSearchContainer class, I got many hints from the Journal module classes as mentioned in my previous post.


Please share CustumSearchContainer.

Thanks and Regards
Anil
Pinkesh Gandhi
RE: <liferay-ui:search-container /> tag issue in liferay config mode
August 16, 2012 7:25 AM
Answer

Pinkesh Gandhi

Rank: Regular Member

Posts: 100

Join Date: January 26, 2012

Recent Posts

Hi Prakash,

As per my knowledge, you don't need to write your own CustomSearchContainer class to resolve the pagination issue.
In order to resolve this issue, please create renderUrl on your configuration.jsp in following way and set that renderUrl as a iteratorUrl in <liferay-ui:search-container /> tag.

1
2<liferay-portlet:renderURL portletConfiguration="true" var="configRenderURL" />
3
4<liferay-ui:search-container .... iteratorUrl='<%=configRenderURL%>' ...>


So now onwards, on lick of pagination links of your search container, the render(...) method your Configuration class (which is mapped by <configuration-action-class> in liferay-portlet.xml) will be called and you will remain on same page of the configuration.

I hope this might resolves your issue.
anil s kolhe
RE: <liferay-ui:search-container /> tag issue in liferay config mode
August 16, 2012 11:01 PM
Answer

anil s kolhe

Rank: New Member

Posts: 22

Join Date: March 11, 2009

Recent Posts

Hi Pinkesh,
I am getting error as
The method setIteratorURL(PortletURL) in the type SearchContainerTag is not applicable for the arguments (String)

Its not taking string parameter. Can you please give details of your solution.

Thanks
Anil
Prakash Khanchandani
RE: <liferay-ui:search-container /> tag issue in liferay config mode
August 21, 2012 12:19 AM
Answer

Prakash Khanchandani

Rank: Expert

Posts: 329

Join Date: February 10, 2011

Recent Posts

The solution which Pinkesh mentions will work.

I had created a customSearchContainer because I had more advanced needs for searching, sorting and fetching of results.
Jay Trivedi
RE: <liferay-ui:search-container /> tag issue in liferay config mode
November 29, 2012 10:46 PM
Answer

Jay Trivedi

Rank: Regular Member

Posts: 107

Join Date: November 23, 2012

Recent Posts

Hi Praksah,
I want to call my method on same jsp page when i click on delete icon rather then directing on another jsp page and executing delete process over there.
1
2 <liferay-ui:search-container-column-text>
3                   
4           <liferay-ui:icon image="edit" method=""></liferay-ui:icon>
5           <liferay-ui:icon image="delete" method="" onClick="<%=callDelete(foo.getFooId)%"></liferay-ui:icon>
6                     
7       </liferay-ui:search-container-column-text>


i tried creating my own scriptlet on same page but it gives error.
<%!
public void callDelete(long id) {
FooLocalServiceUtil.deleteFoo(id);
}
%>

It doesn't works emoticon . Help me out.

Thanks .
Prakash Khanchandani
RE: <liferay-ui:search-container /> tag issue in liferay config mode
December 11, 2012 11:51 PM
Answer

Prakash Khanchandani

Rank: Expert

Posts: 329

Join Date: February 10, 2011

Recent Posts

Hi Jay Trivedi,

I don't see you issue is related to this post in any way, just that you are using <search-container>.

Can you create a new thread and ask this question there with suitable title for the thread? It would be really helpful.
And it would also help keep this thread objective by only discussing about one problem.

Thanks