Skip to Content
avatar image
Former Member

How to change title of the window from view?

Hi SDN,

I want to set the title of the window dynamically.

Can i change the title of the window from the current view?

i am getting the title at modify event of the view

please let me know the way.

Thaks ain advance.

Rahul

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jul 18, 2007 at 03:59 PM

    You can chenge it But i am no clear about Do you want to change the Title of the view or window??

    If it is View, Take a locall controller attrubute and bind this attrubute to the title UI element and make a update for this variable WDDOMODIFYVIEW method.

    If it is Winodw, Then take a componenet controller attrubute and map to the window and bind to the respective UI element and in the same way bind to your view also and make a update for this attrubute in WDDODMIDIFYVIEW method also.

    I hope it may clear for you.

    Warm Regards,

    Vijay

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 18, 2007 at 05:36 PM

    Rahul,

    ....

    Regards,

    Shubhadip

    Removed by moderator because the posting was Web Dynpro Java coding. This is the Web Dynpro ABAP forum.

    Edited by: Thomas Jung on Aug 21, 2008 8:04 AM

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      This code should work in views but unfortunately get_window() returns no reference and it dumps.

      DATA: wd_win_ctlr TYPE REF TO if_wd_window_controller,
              wd_win TYPE REF TO if_wd_window.
        wd_win_ctlr = view->if_wd_view_controller~get_embedding_window_ctlr( ).
        wd_win = wd_win_ctlr->get_window( ).
        wd_win->set_window_title( 'Hello World!' ).   " -> Dump
      

      Surely there is a way to get a reference to the window in an application! All the posts along these lines suggest it is possible but nobody provides a working example. The suggestions all do not work.

  • avatar image
    Former Member
    Dec 12, 2008 at 11:36 AM

    HI

    In the wddoinit of the view write the following code

    IF gr_context_main IS BOUND.

    gr_context_main->set_attribute( name = 'TITLE' value = 'Your Heading').

    ENDIF.

    Declare gr_context_main in the attributes section of assistance class of webdynpro as Instance Public and type ref to IF_WD_CONTEXT_NODE.

    I hope it works

    Add comment
    10|10000 characters needed characters exceeded