如何在liferay 6.2中更改选项卡上的portlet标题

时间:2014-07-02 08:46:23

标签: liferay liferay-6 liferay-theme liferay-ide liferay-aui

我有一个样本tabview portlet.Which基本上是一个带有4个tabs的tabview。我想在更改标签时更改portlet标题。

view.jsp的

<%


    String redirect = ParamUtil.getString(request, "redirect");
%>
<portlet:renderURL var="viewBackURL" />


<div id="myTab">

    <ul class="nav nav-tabs">
        <li class="active"><a href="#tab-1">Basic Info </a></li>
        <li><a href="#tab-2">Address </a></li>
        <li><a href="#tab-3">Relationship </a></li>
        <li><a href="#tab-4">Membership </a></li>
    </ul>

    <div class="tab-content">
        <div id="tab-1">


            <liferay-util:include page="/html/a.jsp"
                servletContext="<%= application %>">

                <liferay-util:param name="redirect"
                    value="<%= String.valueOf(redirect) %>" />

            </liferay-util:include>

        </div>
        <div id="tab-2" class="tab-pane">
            <liferay-util:include page="/html/b.jsp"
                servletContext="<%= application %>">

                <liferay-util:param name="redirect"
                    value="<%= String.valueOf(redirect) %>" />
            </liferay-util:include>
        </div>



        <div id="tab-3" class="tab-pane">
            <liferay-util:include page="/html/c.jsp"
                servletContext="<%= application %>">



                <liferay-util:param name="redirect"
                    value="<%= String.valueOf(redirect) %>" />
            </liferay-util:include>


        </div>



        <div id="tab-4" class="tab-pane">
            <liferay-util:include page="/html/d.jsp"
                servletContext="<%= application %>">



                <liferay-util:param name="redirect"
                    value="<%= String.valueOf(redirect) %>" />
            </liferay-util:include>

        </div>
    </div>

</div>

<aui:script>
YUI().use(
  'aui-tabview',
  function(Y) {
    new Y.TabView(
      {
        srcNode: '#myTab'

      }
    ).render();
  }
);

</aui:script>

我可以使用

更改portlet标题
renderResponse.setTitle("My title");

如何在更改标签时更改标题?有人可以帮助我吗

1 个答案:

答案 0 :(得分:0)

为此你必须使用javascript和Css。这些链接可能会有所帮助。

http://www.liferay.com/web/pankaj.kathiriya/blog/-/blogs/usage-of-liferay-js-object

http://stackoverflow.com/questions/7551639/change-portlet-title-from-code-in-liferay-without-jquery

http://stackoverflow.com/questions/5582669/change-liferay-portlet-title-in-javascript