Skip to Content
author's profile photo Former Member
Former Member

Read iView title from code

Hi,

I have developed an iview (component) where I want access to the iview title, as configured in the PCD, from the code. As I understand, the IPortalComponentProfile should be used to retrieve these properties. It works for two custom properties I'm also using (defined in component profile in portalapp.xml). I can't get it to work with the Title property though.

This is a code segment I've been trying:

IPortalComponentContext myContext = request.getComponentContext();
IPortalComponentProfile myProfile = myContext.getProfile();
String title = myProfile.getProperty("com.sap.portal.pcm.Title");
String title2 = myProfile.getPropertyAttribute("com.sap.portal.pcm.Title", IPortalComponentProfile.PROFILE_ATTRIBUTE_VALUE);

In this example, neither title nor title2 get the value of the proper title for the iview, instead they are both set to "VRB_com.sap.portal.pcm.Title", whatever that may mean. I have tried using "Title" (the value of the deprecated constant for title) instead of "com.sap.portal.pcm.Title", that returns null. I have also tried the deprecated getTitle method of the component profile, it does not work either.

Does anyone have any clue on this problem? I don't want to create a new custom property for this, since there is a standard one, but if I can't find out I guess I will be forced to.

Best regards and thanks in advance,

Erik Eriksson

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Nov 16, 2007 at 05:06 PM

    You should be able to use the following

    request.getNode().getNodeName()
    

    This should retrieve (I think) the display name of the current navigation node, which is basically the component being executed.

    I hope this helps

    D

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      I haven't been able to try this out, but if I understand correctly I will get the navigation name as in e.g. Detailed Navigation? Problem is I was using it for an iview inserted into a web page composer page, so it does not have a navigation node in that respect.

      But, I chose another way of solving the problem, since creating a new iview for each instance was a bit cumbersome anyway: I am using the title of a KM folder instead of iview title.

      Thanks anyway!

      /Erik

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.