Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
James charley
Adding global drop down to filter All portlets on the page.
June 19, 2013 11:06 PM
Answer

James charley

Rank: Junior Member

Posts: 44

Join Date: June 11, 2013

Recent Posts

Team,

I want to add one global drop down(Select box) which is applicable to all portlets. It could part of page data.

E.g. When we change or select any value in that drop down it will reload all portlets or refresh the page. So scope is global.

Is there any way we can achieve this ?

Thanks,
James.
Oliver Bayer
RE: Adding global drop down to filter All portlets on the page.
June 20, 2013 1:23 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 883

Join Date: February 18, 2009

Recent Posts

Hi James,

I would put the drop downs into a custom theme and write the js code to refresh the current page there too. As a theme is applied to the whole page it also affects all the portlets on the page.

HTH Oli
James charley
RE: Adding global drop down to filter All portlets on the page.
June 20, 2013 3:15 AM
Answer

James charley

Rank: Junior Member

Posts: 44

Join Date: June 11, 2013

Recent Posts

Oliver thanks for your response.

I can add these custom fields in to the theme but how to get the current value of the drop down,textbox etc and pass it to each portlet on current page to get proper data.

Question : Assume portlets are scattered across pages(we have multiple tabs) how to refresh only current page portlets using this drop down/text filters value.

And everytime when user go to different page (tab) how to pass current drop down value portlet to show appropriate default data.
James charley
RE: Adding global drop down to filter All portlets on the page.
June 20, 2013 6:03 AM
Answer

James charley

Rank: Junior Member

Posts: 44

Join Date: June 11, 2013

Recent Posts

Oliver is there any way we can achieve this I was thinking we have to drop this idea and say it is not possible with liferay.
Oliver Bayer
RE: Adding global drop down to filter All portlets on the page.
June 20, 2013 7:42 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 883

Join Date: February 18, 2009

Recent Posts

Hi James,

I don't think this is a Liferay "problem" but it's more of a general question on how to implement this. A quick -and maybe not the cleanest emoticon- solution would be to add a page refresh script and add values to the dropdown which get added to the current url. I will try to describe it with some pseudo-code lines:
1<form>
2   <select name="globalPageParam" onchange="this.form.submit()">
3      <option value="paramValue1">Option 1</option>
4      <option value="paramValue2">Option 2</option>
5   </select>
6</form>

Maybe you can also create a so-called renderURL (see the following blog) dynamically inside the theme vm template. I've never had this use case so you have to investigate further but if you have any questions feel free to ask again.

Greets Oli
James charley
RE: Adding global drop down to filter All portlets on the page.
June 20, 2013 11:54 PM
Answer

James charley

Rank: Junior Member

Posts: 44

Join Date: June 11, 2013

Recent Posts

Oliver Thanks for your input. I already tried it what ever you have told.

Now I want to go one step ahead which is to do following.

1) Load specific portlet based on current page. (For example there are 2 pages and on each page we have 4 portlet)
If user is on page 1 it should load only portlet related to that page. This should not be full page refresh.

2) Load only specific portion of the portlet on the given page (AJAX) donot whole portlet.

I am finding it really hard and donot want to hard code portlet names or write two many if condition

e.g. if it is page 1 send AJAX request for these portlets and page 2 these portlets and so on it will not scale.
James charley
RE: Adding global drop down to filter All portlets on the page.
June 24, 2013 3:08 AM
Answer

James charley

Rank: Junior Member

Posts: 44

Join Date: June 11, 2013

Recent Posts

Guys,

Any idea . Basically I want to make AJAX calls for portlet on current page based on global event.