问题
Does it possible to change liferay portlet title using javascript? For example I have a couple of divs, one of them is shown, other are hidden. I press the button and different div is going to be shown. Portlet title must be name of that div.
There is portletTitleEdit function in util.js, but seems it's not the function I need, because it tries to save the portletTitle via ajax. I need just to substitute the title.
回答1:
You could add some custom javascript as jQuery is available something like
$('#idOfPortlet').find('.portlet-title').html('new title'); would suffice. This would narrow this down to a particular portlet you could include this using the liferay-portlet.xml file in your portlet
来源:https://stackoverflow.com/questions/5582669/change-liferay-portlet-title-in-javascript