cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Text in the Page Header

former_member222068
Active Participant
0 Kudos

Hi Gurus,

I have a small requirement i.e., changing the text of title on page header UI element based on condition. if create then create data else if it is display then display the info some thing like that.

Kindly can some help me regarding this....

Regard

Sankar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sankar,

Instead of Page header use TEXTVEIW UI Element to set page heading. you can set different colors and diff fonts

using TEXTVIEW.

Declare an attribute of type sting and bind the text peroperty of the Textview UI element. and then you can hange

the value of the variable dynamically and same will be reflected in the TextView.

Use set_attribute to set text based on your requirement.

Cheers,

Kris.

former_member222068
Active Participant
0 Kudos

Hi,

i was asked to use page header. No any alternative for me....

Regards

Sankar

Former Member
0 Kudos

Hi Sankar,

Create on eattribute of type String and bind to title property of page header,

and your WDDOINIT or any event write code to set title for PG header,

You are using different buttons, use this code in your buttons and change text.

DATA lo_el_context TYPE REF TO if_wd_context_element.
  DATA ls_context TYPE wd_this->Element_context.
  DATA lv_pg TYPE wd_this->Element_context-pg.

* get element via lead selection
  lo_el_context = wd_context->get_element( ).

  data pg1 type string.

  pg1 = 'selected the record'.
  lv_pg = Pg1.

* set single attribute
  lo_el_context->set_attribute(
    name =  `PG`
    value = lv_pg ).

In button 1..

lv_pg = 'Enter the entries'.
* set single attribute
  lo_el_context->set_attribute(
    name =  `PG`
    value = lv_pg ).

Cheers,

Kris.

Answers (1)

Answers (1)

praveen_reddy2
Active Participant
0 Kudos

Hi sankar,

We can get dynamic text in page heaeder UI element..

Will u explain bit clearly your requirement?

Regards,

Praveen.

former_member222068
Active Participant
0 Kudos

Hi Praveen,

say for example: view1: create screen view2: display screen

Now if i am clicking on button 1 : it has to display me the create screen( that has been done ). now i have to display text * 'Enter the entries' *'and when i click on button 2: it has to display me display screen and text has to be * 'selected the record'*.

Hope am i clear.

Regards

Sankar

Former Member
0 Kudos

check out this interface IF_WDY_MD_PAGE_HEADER ,

u can use its methods to change page header title dynamically at WDDOMODIFYVIEW method

Aisurya
Participant
0 Kudos

Hi sankar ,

U can bind the title of the Pageheader to an attribute of type string which u have to declare in the context , and can pass the value or set the attribute value using " IF_WD_CONTEXT_ELEMENT->SET_ATTRIBUTE".

And it can change according to your business logic.

Thanks

Aisurya