André Lima
André Lima

Reputation: 21

Liferay Embedded portlet does not call render function

I have looked everywhere for this bug and I have seen no other issue

Currently I am using Liferay 7.0 and I embedded my portlet in a web content template like so:

 <div class ="container-fluid">
        <div class ="row">
            <div class ="col-md-6 col-sm-6">

         <#assign VOID = freeMarkerPortletPreferences.setValue("portletSetupPortletDecoratorId", "barebone") />
       <@liferay_portlet["runtime"]
             defaultPreferences="${freeMarkerPortletPreferences}"
             portletProviderAction=portletProviderAction.VIEW
             portletName="foo" />
             ${freeMarkerPortletPreferences.reset()}
            </div>
        </div>
    </div>

Portlet works fine outside of the freemarker template, however inside it actionRequest button is called but it never enters render function so the buttons I set do nothing.

Is there any special requirement for a portlet to be put inside a freemarker template? Did I forget anything?

Upvotes: 2

Views: 690

Answers (1)

Ori Marko
Ori Marko

Reputation: 58902

It seems that you are embedding by portletName so it can be either:

Instanceable, and then you need to provide its instance ID, as:

 instanceId="INSTANCE_ID"

If not, set com.liferay.portlet.instanceable=false

If your portlet is instanceable, an instance ID must be provided; otherwise, you can remove this line. To set your portlet to non-instanceable, set the property com.liferay.portlet.instanceable in the component annotation of your portlet to false.

Upvotes: 0

Related Questions