Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Robert Leo Smith
Change the portlet title from code
1 agosto 2011 9.18
Risposta

Robert Leo Smith

Punteggio: New Member

Messaggi: 18

Data di Iscrizione: 15 ottobre 2009

Messaggi recenti

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 agosto 2011 12.01
Risposta

Jelmer Kuperus

Punteggio: Liferay Legend

Messaggi: 1187

Data di Iscrizione: 10 marzo 2010

Messaggi recenti

renderResponse.setTitle
Robert Leo Smith
RE: Change the portlet title from code
15 agosto 2011 6.50
Risposta

Robert Leo Smith

Punteggio: New Member

Messaggi: 18

Data di Iscrizione: 15 ottobre 2009

Messaggi recenti

How do i get renderResponse?
Raja Nagendra Kumar
RE: Change the portlet title from code
15 agosto 2011 7.01
Risposta

Raja Nagendra Kumar

Punteggio: Expert

Messaggi: 478

Data di Iscrizione: 1 marzo 2006

Messaggi recenti

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 agosto 2011 10.35
Risposta

Rob Chan

Punteggio: Junior Member

Messaggi: 82

Data di Iscrizione: 23 marzo 2011

Messaggi recenti

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 febbraio 2012 9.51
Risposta

Robert Leo Smith

Punteggio: New Member

Messaggi: 18

Data di Iscrizione: 15 ottobre 2009

Messaggi recenti

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 febbraio 2012 11.27
Risposta

Terry Jeske

Punteggio: Junior Member

Messaggi: 42

Data di Iscrizione: 23 giugno 2010

Messaggi recenti

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 febbraio 2012 11.44
Risposta

Robert Leo Smith

Punteggio: New Member

Messaggi: 18

Data di Iscrizione: 15 ottobre 2009

Messaggi recenti

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 giugno 2012 16.39
Risposta

Jon Cruz

Punteggio: New Member

Messaggi: 14

Data di Iscrizione: 17 maggio 2012

Messaggi recenti

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