Topic
  • No replies
shirry
shirry
1 Post

Pinned topic Troubles with dynamically changing portlet title on quickr.

‏2010-05-10T08:12:38Z |
Hi everyone! I have a problem with my portlet: it was made for using on WS Portal 6.0 and had an ability to change it's title, but when we replaced portal by quickr 8.0, this ability was lost. When we place this portlet on some node's page, title becomes static.

That's how I learned dynamic titles:
Link: http://www.ibm.com/developerworks/websphere/library/techarticles/0612_rick/0612_rick.html

In control.jsp of my quickr theme I wrote

<div id=
"title.<portal-skin:portletID/>" class=
"portletTimeMeasuring" style=
"position: absolute; display:none;"> <portal-skin:portletTitle><portal-fmt:problem bundle=
"nls.problem"/></portal-skin:portletTitle>:   processing time: <%= System.currentTimeMillis() - portletStartTime %> ms </div>


In portlet.java:




public 

void doEdit(RenderRequest request, RenderResponse response) 

throws PortletException, IOException 
{ ... response.setTitle(
"my portlet title"); .... 
}


In portletEdit.jsp:


<script type=
"text/javascript"> var dynamicTitle =            
"<%=request.getAttribute(com.ibm.portal.portlet.Constants.DYNAMIC_TITLE)%>"; alert(dynamicTitle); var titleElement = document.getElementById(
"title.<portal-skin:portletID/>"); alert(titleElement); 

if (titleElement != 

null) 
{ 

if (dynamicTitle != 
"" && dynamicTitle != 
"null") titleElement.innerHTML = dynamicTitle; alert(
'done'); 
} alert(
'all right') </script>


"alert(dynamicTitle)" shows "myPortletTitle", so this is right, but when it goes through "alert(titleElement)" I see message "null".
I think that control.jsp in wps.ear/wps.war/skins/html/myTheme is not what I need, but can't find other .jsp with <portal-skin> tags.

Сan you give me an advice, what I must change?

Thanks!