Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Manish Kumar
Filtering in searchcontainer
January 2, 2013 11:06 PM
Answer

Manish Kumar

Rank: Junior Member

Posts: 94

Join Date: March 1, 2012

Recent Posts

Hello Everyone,
I want to add drop down filtering in my search container, Can any one help me in that?
Thanks in advance.
Manish Kumar
Manish Kumar
RE: Filtering in searchcontainer
January 2, 2013 11:25 PM
Answer

Manish Kumar

Rank: Junior Member

Posts: 94

Join Date: March 1, 2012

Recent Posts

I want to add feature for that i am attaching my screenshot. Please help me.
Attachments: filterEx.bmp (1,080.1k)
Amit Doshi
RE: Filtering in searchcontainer
January 3, 2013 1:25 AM
Answer

Amit Doshi

Rank: Liferay Master

Posts: 544

Join Date: December 29, 2010

Recent Posts

Manish Kumar:
I want to add feature for that i am attaching my screenshot. Please help me.


Suppose if you are using search container of liferay then you need to refresh the page.

If page refresh is Ok for you then you can do simple thing, pass that parameter in controller and use the Dynamic Query or your service classes method depending on the data you required.

And render the Search container as you required.

For more knowledge on the Search container in liferay.

Refer this link.

And one more thing, if you need to apply filter without page refresh then my suggestion is to use Jquery and also pagination of jquery.

Thanks & Regards,
Amit Doshi
Manish Kumar
RE: Filtering in searchcontainer
January 3, 2013 1:49 AM
Answer

Manish Kumar

Rank: Junior Member

Posts: 94

Join Date: March 1, 2012

Recent Posts

Thank you Amit,
I did not understood completely what you were suggesting. I hope you were indicating for the drop down in my attached snap shot.
Can you please give me some more brief about this.
Thanks,
Manish Kumar
Amit Doshi
RE: Filtering in searchcontainer
January 3, 2013 1:52 AM
Answer

Amit Doshi

Rank: Liferay Master

Posts: 544

Join Date: December 29, 2010

Recent Posts

Manish Kumar:
Thank you Amit,
I did not understood completely what you were suggesting. I hope you were indicating for the drop down in my attached snap shot.
Can you please give me some more brief about this.
Thanks,
Manish Kumar


You need to pass that parameter of the filter in the method, and depending on the parameter of the filter try to get the data from your custom service or using dynamic query to get the same.

Hope you got it.

Thanks & Regards,
Amit Doshi
Rewati Raman
RE: Filtering in searchcontainer
January 3, 2013 2:37 AM
Answer

Rewati Raman

Rank: Junior Member

Posts: 97

Join Date: February 24, 2012

Recent Posts

Hi Amit,

it would be very helpful if you provide some sample example how to achieve jquery with seach container.
As I am looking forward to do this with Jquery but not getting proper way

Thanks & Regards,
Rewati Raman
Jitendra Rajput
RE: Filtering in searchcontainer
January 3, 2013 2:47 AM
Answer

Jitendra Rajput

Rank: Liferay Master

Posts: 742

Join Date: January 7, 2011

Recent Posts

If i am not wrong then Amit is trying to say is ..

-Submit form on onChange event of dropdown . Read this dropdown parameter at the control side.
-Fetch result from database using dynamic query/Finder method
-Pass result to view part.
Amit Doshi
RE: Filtering in searchcontainer
January 3, 2013 3:08 AM
Answer

Amit Doshi

Rank: Liferay Master

Posts: 544

Join Date: December 29, 2010

Recent Posts

Rewati Raman:
Hi Amit,

it would be very helpful if you provide some sample example how to achieve jquery with seach container.
As I am looking forward to do this with Jquery but not getting proper way

Thanks & Regards,
Rewati Raman



I think you get me wrong here. I am trying to say that If you want implement filters with the help of Ajax(or without page refresh) then try to use jquery because search container required page refresh.

Both combine jquery and search container together. Both are entirely different approach.

Thanks & Regards,
Amit Doshi
Amit Doshi
RE: Filtering in searchcontainer
January 3, 2013 3:09 AM
Answer

Amit Doshi

Rank: Liferay Master

Posts: 544

Join Date: December 29, 2010

Recent Posts

Jitendra Rajput:
If i am not wrong then Amit is trying to say is ..

-Submit form on onChange event of dropdown . Read this dropdown parameter at the control side.
-Fetch result from database using dynamic query/Finder method
-Pass result to view part.


Thanks Jitendra for making it more clear on my scenario.
Manish Kumar
RE: Filtering in searchcontainer
January 3, 2013 3:33 AM
Answer

Manish Kumar

Rank: Junior Member

Posts: 94

Join Date: March 1, 2012

Recent Posts

Thank you so much Amit and Jitendra.
This is very clear now. Now i am very confident that it will work.
I will try it now.

Thanks,
Manish Kumar
Manish Kumar
RE: Filtering in searchcontainer
January 4, 2013 2:45 AM
Answer

Manish Kumar

Rank: Junior Member

Posts: 94

Join Date: March 1, 2012

Recent Posts

As per my requirement it should come below the header and above the table. I am not able to get the drop down there.
Please help in that.
Thanks,
Manish Kumar.