掲示板

RE: Change the portlet title from code

thumbnail
12年前 に Robert Leo Smith によって更新されました。

Change the portlet title from code

Junior Member 投稿: 63 参加年月日: 09/10/15 最新の投稿
I would like to be able to change the portlet title programatically. Does anyone know of a way to do this?
thumbnail
12年前 に jelmer kuperus によって更新されました。

RE: Change the portlet title from code

Liferay Legend 投稿: 1191 参加年月日: 10/03/10 最新の投稿
renderResponse.setTitle
thumbnail
12年前 に Robert Leo Smith によって更新されました。

RE: Change the portlet title from code

Junior Member 投稿: 63 参加年月日: 09/10/15 最新の投稿
How do i get renderResponse?
thumbnail
12年前 に Raja Nagendra Kumar によって更新されました。

RE: Change the portlet title from code

Expert 投稿: 484 参加年月日: 06/03/02 最新の投稿
In JSP you could directly have access to renderResponce..
by tags

<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<portlet:defineObjects/>

see the tutorial to

http://docs.jboss.org/jbportal/v2.4/reference-guide/en/html/tutorials.html

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com
thumbnail
12年前 に Rob Chan によって更新されました。

RE: Change the portlet title from code

Junior Member 投稿: 82 参加年月日: 11/03/23 最新の投稿
Also if you make a MVC portlet, the doView and doEdit methods get passed the renderRequest and renderResponse variables automatically, so you only need to reference it.
thumbnail
12年前 に Robert Leo Smith によって更新されました。

RE: Change the portlet title from code

Junior Member 投稿: 63 参加年月日: 09/10/15 最新の投稿
I guess I should have elaborated some more. We are using ICEfaces for portlet development. The request object is not easily available to get the portlet title from.
thumbnail
12年前 に Terry Jeske によって更新されました。

RE: Change the portlet title from code

Junior Member 投稿: 42 参加年月日: 10/06/23 最新の投稿
I think I have a similar problem. I am using Spring Portlet MVC and need access to some of the private RenderResponse fields (namely the _plid value).
thumbnail
12年前 に Robert Leo Smith によって更新されました。

RE: Change the portlet title from code

Junior Member 投稿: 63 参加年月日: 09/10/15 最新の投稿
Hi Terry,

I've only done some Spring MVC examples. But don't you have the request object available via the controller?
11年前 に Jon Cruz によって更新されました。

RE: Change the portlet title from code

New Member 投稿: 14 参加年月日: 12/05/17 最新の投稿
I'm a bit late to the party, but the Spring Portlet MVC way of doing it -- for those who are using that framework -- I have used:


	protected ModelAndView handleRenderRequestInternal(RenderRequest renderRequest, RenderResponse renderResponse) throws Exception {

		Map<string,object> model = new HashMap<string,object>();

		try {
			
			renderResponse.setTitle("This be a test, yarrr.");
			... other code
			... other code
			... other code


		} catch (Exception e) {
			e.printStackTrace();
		}

		ModelAndView modelAndView = new ModelAndView("Home", model);

		return modelAndView;
	}
</string,object></string,object>


My portlet then rendered with that title.

Jon

Update: Ah, I see that Jelmer mentioned this on the second post. Well, here's an example of it's use...)