-
1. Re: Add portlet display name programatically.
cpage Mar 13, 2009 5:16 AM (in response to peris)In some portlets, i use RenderResponse.setTitle("NAME") in doView and doEdit to personalize windows names.
I think it's the code you need. -
2. Re: Add portlet display name programatically.
peris Mar 13, 2009 6:32 AM (in response to peris)Hi apemberton
For example in portal.xml
<display-name>My portlets</display-name>.
If I minimize the above portlet it shows the name "My portlets".
But in my dynamic creation portlet i cant set the display name programatically.(No portal.xml for this portlet everything is generated through coding). If I set displayname in dynamic portlet my problem is solved. -
3. Re: Add portlet display name programatically.
je.a.le Mar 13, 2009 10:59 AM (in response to peris)Override the getTitle method in the portlet code, and return your own portlet's title.
Nota : getTitle is called first, and outside any "processAction/doView" operation, depending on how you get your data, you may have to do it twice.
If the name only change only according to page node, you can used properties too.
Here a sample code i used,public class xxxxPortlet extends JBossPortlet { // other relevant code here..... @Override protected String getTitle(RenderRequest request) { return (String) (((JBossRenderRequest) request).getPortalNode().getProperties().get("title")); } }