Absolute Layout not working in Portlet

Hi ,

Im new to Vaadin and was trying to use Vaadin to create a sample portlet. I created a CustomComponent using Vaadin’s Visual User Interface Designer, and integrated it into the window of the portlet. But when i deployed the same in Liferay, the component was not displayed within the portlet.

But when i changed the layout from Absolute Layout to Vertical Layout, the component was visible within the portlet.

Does Absolute Layout has any extra configurations required to get the component visible?

Thanks
Ranjith

Have you defined an explicit size (non-relative) for the custom component or the absolute layout? My quick guess is that something is 100% of 0px (= pretty much invisible).

cheers,
matti

Hi Matti,

Thanks for your reply.

I have not explicitily defined any size for the custom component or absolute layout. But the designer has set the width and height for the component in the designer generated code.

In the portlet window that i created, I am just adding this custom component to that window. I am not defining any size there either.

Thanks
RP

Any help on this?

I know this is an old thread, but I came across the same issue just now and didn’t find any solution so I figured it out myself.
It might help some other people looking for this solution.

There are, as far as I can tell 2 solutions to your issue:

1/ Set the height of your portlet in the portlet.xml


<init-param>
  <name>style</name>
  <value>width:846px; height:560px</value>
</init-param>

2/ Set the height of your ‘top’ component to a fixed value and not a percentage value.
Keep in mind that 100% of 0px is still 0px.
What I tried at first was create a VerticalLayout with a fixed height of 560px and a width of 846px.
The liferay ‘panel’ (for lack of a better word) in which the portlet is shown adjusted itself to my specified dimensions.

Keep in mind that I didn’t test this within a pre-formed liferay layout with 23 columns and 43 other portlets. Just a blank page with just my specific portlet running