Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Tiziano Treccani
Extend "Nested Portlets" portlet
June 12, 2008 11:03 AM
Answer

Tiziano Treccani

Rank: New Member

Posts: 10

Join Date: April 4, 2008

Recent Posts

Hi all.
I'm developing a custom portlet in order to add inside it some other portlets. This custom portlet must be tabbed, and some portlets must be in one tab and others in other tabs.

I had already extended the "Nested Portlets" portlet and implemented tabs, and i can dinamically include jsp pages depending on the tab I'm in. In these pages I put the code is in the "NestedPortlet" 's view.jsp in order to make my custom jsp ables to accept portlet to drag inside them. This works, each page has its dragging area and accept portlets, but if I drag one portlet in the first tab, I expect that if I go to the second tab It's clear without any portlet, but no, I see the portlet dragged into the first tab.

Anybody have any suggestion?

Thank a lot ;-)
Carlo G.
RE: Extend "Nested Portlets" portlet
February 15, 2012 8:10 AM
Answer

Carlo G.

Rank: New Member

Posts: 3

Join Date: November 4, 2011

Recent Posts

Hi,
did you have success in extending Nested Portlet in tabbed version?
If so, please let me know, as I am trying to do the same.

Thank you,
Carlo
Portal Team
RE: Extend "Nested Portlets" portlet
February 23, 2012 9:52 PM
Answer

Portal Team

Rank: New Member

Posts: 6

Join Date: February 22, 2012

Recent Posts

Carlo G.:
Hi,
did you have success in extending Nested Portlet in tabbed version?
If so, please let me know, as I am trying to do the same.

Thank you,
Carlo


Hi All,

Please share the steps for implementing the nested portlets in tabbed version.
Thanks in Advance....
Carlo G.
RE: Extend "Nested Portlets" portlet
February 24, 2012 1:28 AM
Answer

Carlo G.

Rank: New Member

Posts: 3

Join Date: November 4, 2011

Recent Posts

I did not implement such a portlet.

I resolved by implementing a "tab" portlet with view and edit mode: in edit mode user inserts the id of portlets to be tabbed.
Since ids of these portlets are also the ids of their enclosing div, the Tab portlet switches its tabs by hiding/showing divs with javascript.

It's a workaround, and Nested Tabbed portlet would be really appreciated.

Carlo
Stian Sigvartsen
RE: Extend "Nested Portlets" portlet
February 27, 2012 12:44 AM
Answer

Stian Sigvartsen

Rank: Regular Member

Posts: 103

Join Date: August 27, 2010

Recent Posts

This is something I also would be interested in having as a feature in Liferay and it would seen 1700+ others do too judging from the number of thread views!
Maybe one of the core developers could spare a minute to comment on the feasibility of implementing this functionality? Also it would be good if the nested portlet generated render/action URLs that function correctly when portlet is rendered as a widget via the provided JavaScript found on the "sharing" configuration tab.

-Stian
Jaynil A Bagdai
RE: Extend "Nested Portlets" portlet
June 6, 2012 10:01 PM
Answer

Jaynil A Bagdai

Rank: Regular Member

Posts: 120

Join Date: March 3, 2012

Recent Posts

Tiziano Treccani:
Hi all.
I'm developing a custom portlet in order to add inside it some other portlets. This custom portlet must be tabbed, and some portlets must be in one tab and others in other tabs.

I had already extended the "Nested Portlets" portlet and implemented tabs, and i can dinamically include jsp pages depending on the tab I'm in. In these pages I put the code is in the "NestedPortlet" 's view.jsp in order to make my custom jsp ables to accept portlet to drag inside them. This works, each page has its dragging area and accept portlets, but if I drag one portlet in the first tab, I expect that if I go to the second tab It's clear without any portlet, but no, I see the portlet dragged into the first tab.

Anybody have any suggestion?

Thank a lot ;-)



Hi Tiziano,

Its great that you have achieved this functionality by extending Nested portlet. I am having the same requirement in my project that I would like to display tabs(which itself are portlets) in a portlet.
So please share steps or example that how would I achieve that.

waiting for your response.

Thanks in advance.
Br1 no
RE: Extend "Nested Portlets" portlet
June 19, 2013 1:36 AM
Answer

Br1 no

Rank: New Member

Posts: 11

Join Date: December 12, 2012

Recent Posts

Bit late, but I had develop a tabbed nested portlet, there are the steps.

1º Create a dinamyc tpl to enable N tabs. You can use any other template, but with a fixed number of columns.
Here are the code of this tpl
 1<div class="NestedToTabbedLayout" id="main-content" role="main">
 2    <div class="portlet-layout senchaLayout" id="nestedTabsId">
 3    #if (!$request.getAttribute("myNumberOfTabs"))   
 4        <div class="senchatab portlet-column portlet-column-only" id="column-1">
 5            $processor.processColumn("column-1", "portlet-column-content portlet-column-content-only")
 6        </div>
 7    #else
 8            #set ($Integer = 0)
 9            #set ($tabsInNumber = $Integer.parseInt($request.getAttribute("myNumberOfTabs")))
10            #if ($tabsInNumber > 0)               
11                #foreach($i in [1..$tabsInNumber])
12                #set ($columnNum = ("column-$i"))       
13                #set ($naname = "_118_INSTANCE_$portletDisplay.getInstanceId()_${columnNum}")
14                <div class="senchatab portlet-column portlet-column-only" id="column-$i">                   
15                    $processor.processColumn($naname,"portlet-column-content portlet-column-content-only")
16                </div>
17                #end
18            #end
19    #end
20    </div>
21</div>


2º Reading this code, you need to overrite(I used an ext project) the viewAction of native nested portlet (I can't do a nested portlet in a non native context) in order to add 'myNumberOfTabs' parameter. You might want to add a configuration parameter in ConfigurationActionImpl to configure this number. As said before, you dont need to do this if dont want dinamyc columns.

3º Modify html/jsp/portlet/nested_portlets/view.jsp (I used a hook) to manage tabs. I use the class name sencha tab to iterate over the columns and add tab support.You might want to edit configuration.jsp to add dinamyc number of columns.

Now I have to said that my code have some bugs, that im working on to resolve.
  1. After save the configuration the method the page loads in a ugly way(appling the nested layout to the page). This effect is gone after reload. I solve this one by removing the call super.processAction in ConfigurationActionImpl.
  2. I recently change my script, and now I can't remove portlets from inside of the nested portlet layout. Working on a solution.


Hope this helps someone!!
Bruno.