Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Robert Leo Smith
Change the portlet title from code
1 de Agosto de 2011 09:18
Resposta

Robert Leo Smith

Ranking: New Member

Mensagens: 19

Data de entrada: 15 de Outubro de 2009

Mensagens recentes

I would like to be able to change the portlet title programatically. Does anyone know of a way to do this?
Jelmer Kuperus
RE: Change the portlet title from code
1 de Agosto de 2011 12:01
Resposta

Jelmer Kuperus

Ranking: Liferay Legend

Mensagens: 1192

Data de entrada: 10 de Março de 2010

Mensagens recentes

renderResponse.setTitle
Robert Leo Smith
RE: Change the portlet title from code
15 de Agosto de 2011 06:50
Resposta

Robert Leo Smith

Ranking: New Member

Mensagens: 19

Data de entrada: 15 de Outubro de 2009

Mensagens recentes

How do i get renderResponse?
Raja Nagendra Kumar
RE: Change the portlet title from code
15 de Agosto de 2011 07:01
Resposta

Raja Nagendra Kumar

Ranking: Expert

Mensagens: 484

Data de entrada: 1 de Março de 2006

Mensagens recentes

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
Rob Chan
RE: Change the portlet title from code
17 de Agosto de 2011 10:35
Resposta

Rob Chan

Ranking: Junior Member

Mensagens: 82

Data de entrada: 23 de Março de 2011

Mensagens recentes

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.
Robert Leo Smith
RE: Change the portlet title from code
8 de Fevereiro de 2012 09:51
Resposta

Robert Leo Smith

Ranking: New Member

Mensagens: 19

Data de entrada: 15 de Outubro de 2009

Mensagens recentes

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.
Terry Jeske
RE: Change the portlet title from code
8 de Fevereiro de 2012 11:27
Resposta

Terry Jeske

Ranking: Junior Member

Mensagens: 42

Data de entrada: 23 de Junho de 2010

Mensagens recentes

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).
Robert Leo Smith
RE: Change the portlet title from code
8 de Fevereiro de 2012 11:44
Resposta

Robert Leo Smith

Ranking: New Member

Mensagens: 19

Data de entrada: 15 de Outubro de 2009

Mensagens recentes

Hi Terry,

I've only done some Spring MVC examples. But don't you have the request object available via the controller?
Jon Cruz
RE: Change the portlet title from code
14 de Junho de 2012 16:39
Resposta

Jon Cruz

Ranking: New Member

Mensagens: 14

Data de entrada: 17 de Maio de 2012

Mensagens recentes

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:

 1
 2    protected ModelAndView handleRenderRequestInternal(RenderRequest renderRequest, RenderResponse renderResponse) throws Exception {
 3
 4        Map<String,Object> model = new HashMap<String,Object>();
 5
 6        try {
 7            
 8            renderResponse.setTitle("This be a test, yarrr.");
 9            ... other code
10            ... other code
11            ... other code
12
13
14        } catch (Exception e) {
15            e.printStackTrace();
16        }
17
18        ModelAndView modelAndView = new ModelAndView("Home", model);
19
20        return modelAndView;
21    }


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...)