Foren

Bug? Using portlet inside theme removes "selected" attribute for navigatio

s w, geändert vor 14 Jahren.

Bug? Using portlet inside theme removes "selected" attribute for navigatio

New Member Beiträge: 15 Beitrittsdatum: 15.07.08 Neueste Beiträge
we have integrated a portlet within a theme using $theme.runtime(PORTLET_NAME) - this works fine. But there is a little side effect with this.
after integrating a portlet the theme navigation is missing the "selected" attribute - within the navigation.vm the call $nav_item.isSelected() always returns false.

Debugging through the sources shows that the “tilesSelectable” attribute is always set to false and thereby the check navItem.isSelected() within the navigation.vm also returns false. Here we have got no idea why the “tilesSelectable” within VelocityVariables is set differently.

Can someone help or check this? LP version 5.2.3 on TC 6.0.20 with MySQL 5.1.x


thx
s w, geändert vor 14 Jahren.

What is the meaning of "tilesSelectable"?

New Member Beiträge: 15 Beitrittsdatum: 15.07.08 Neueste Beiträge
No answers until now. Can anyone explain the usage of "tilesSelectable" used within the ThemeDisplay, set within the VelocityVariables?

thx for any help.
Oliver Bayer, geändert vor 14 Jahren.

RE: What is the meaning of "tilesSelectable"?

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
Hi s w,

I've added a link to this thread to the jira issue I've created for a while.
Please vote for it, add a comment ...... to get this bug fixed ;-).

Oli
Oliver Bayer, geändert vor 14 Jahren.

RE: Bug? Using portlet inside theme removes "selected" attribute

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
Hi,

sorry I cannot solve your problem but I'm facing similar side effects while using $theme.runtime which breaks the side navigation in my case. I've created this jira ticket but get no response till today. So maybe you can comment your problem to this issue because it seems to be related and maybe we get a patch ;-).

Greets Oli
aga flaga, geändert vor 14 Jahren.

RE: Bug? Using portlet inside theme removes "selected" attribute

New Member Beiträge: 2 Beitrittsdatum: 09.11.09 Neueste Beiträge
I had exactly the same problem. In my case the workaround was to set in liferay-portlet.xml:

<use-default-template>false</use-default-template>

for this included portlet. Sounds crazy, but for us it works. We use liferay 4.3.
Oliver Bayer, geändert vor 14 Jahren.

RE: Bug? Using portlet inside theme removes "selected" attribute

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
Hi,

thanks for sharing the info!
But if you create a new portlet with liferay 5.2.3 sdk your mentioned solution is set as default.in liferay-portlet.xml. Do you know why setting this property to false fixed the issue in liferay 4.3?? Maybe we must set it to true in 5.2.3 to get it to work ;-). A feedback from a developer would be great and much appreciated.

Oli
a flagge, geändert vor 14 Jahren.

RE: Bug? Using portlet inside theme removes "selected" attribute

New Member Beiträge: 2 Beitrittsdatum: 09.11.09 Neueste Beiträge
There's also a second solution for this - without changing use-default-template (but again in liferay 4.3!).
Code responsible for that is in render_portlet.jsp - original code:

<c:choose>
<c:when test="<%= useDefaultTemplate || portletException %>">
<tiles:insert template='<%= Constants.TEXT_HTML_DIR + "/common/themes/portlet.jsp" %>' flush="false">
<tiles:put name="portlet_content" value="<%= portletContent %>" />
</tiles:insert>
</c:when>
<c:otherwise>
<%= renderRequestImpl.getAttribute(WebKeys.PORTLET_CONTENT) %>
</c:otherwise>
</c:choose>

causes the bug - menu aren't selectable. But after adding additional line:

<c:choose>
<c:when test="<%= useDefaultTemplate || portletException %>">
<tiles:insert template='<%= Constants.TEXT_HTML_DIR + "/common/themes/portlet.jsp" %>' flush="false">
<tiles:put name="portlet_content" value="<%= portletContent %>" />
<tiles:put name="selectable" value="true" /> <!-- NEW LINE !!! -->
</tiles:insert>
</c:when>
<c:otherwise>
<%= renderRequestImpl.getAttribute(WebKeys.PORTLET_CONTENT) %>
</c:otherwise>
</c:choose>

problem is solved - menu works ok. I suppose in liferay 5 you can also find a place to add something like this.
This fragment also shows, why configuring useDeafultTemplate does matter (other block is executed).
Oliver Bayer, geändert vor 14 Jahren.

RE: Bug? Using portlet inside theme removes "selected" attribute

Liferay Master Beiträge: 894 Beitrittsdatum: 18.02.09 Neueste Beiträge
Cool :-)! Once again thanks for the help!
Tomorrow I'll give it a try. Does this one line solve all the navigation issues I've had e.g. navigation don't list child pages .... (see my jira ticket, link in this thread)? I can only list all top navigation pages. Is this all related to the "selectable"?

Greets Oli