cancel
Showing results for 
Search instead for 
Did you mean: 

Get values from VIEW1 to VIEW2

Former Member
0 Kudos

Hi all,

Sorry, i have read all the forum and blogs, but i cannot undestand.

I have one window and two two views.

All elements on this views created dinamically.

How i can get ID of the button in VIEW2, on what i have click in VIEW1.

I have Inbound Plugs on VIEW2.

There i have written:

wd_context->set_attribute( name = 'MY_TEXT' value = ID ).

MY_TEXT it is a only one static field, wich i have created on VIEW2.

In method WDDOMODIFYVIEW i am write:

CALL METHOD WD_CONTEXT->GET_ATTRIBUTE

EXPORTING

NAME = 'MY_TEXT'

IMPORTING

VALUE = MY_CONSTRUCTION_TEXT.

And all works correct!

Then i create CAPTION on VIEW2 with text = MY_CONSTRUCTION_TEXT.

But when i click BACK button on my VIEW2 and return to VIEW1, i try to click at onether button with another id.

When i do this, after

CALL METHOD WD_CONTEXT->GET_ATTRIBUTE

EXPORTING

NAME = 'MY_TEXT'

IMPORTING

VALUE = MY_CONSTRUCTION_TEXT.

MY_CONSTRUCTION_TEXT is EMPTY.

Why when i do this second time - a have empty value, but first run is all OK?

P.S.: EMPTY is default value of MY_TEXT.

P.S>: When i call VIEW1 and VIEW2 all time the nodes removed and then created again(i need so).

Sorry for my english.

Please, help me. It is very important for me!!!

Points guaranted.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

upd:

But when i change Element (not use LR_CONTAINER->REMOVE_ALL_CHILDREN( ). )

- All Correct.


  if first_time = ''.
  LR_CAPTION ?= view->GET_ELEMENT( 'CONSTRUCTION' ).
  CALL METHOD WD_CONTEXT->GET_ATTRIBUTE
    EXPORTING
      NAME  = 'TEXT'
    IMPORTING
      VALUE = MY_CONSTRUCTION_TEXT.

  MY_TEXT = MY_CONSTRUCTION_TEXT.
  LR_CAPTION->SET_TEXT( MY_TEXT ).
  endif.

Why?

Former Member
0 Kudos

Maybe LR_CONTAINER->REMOVE_ALL_CHILDREN( ). removes static fields too?

Former Member
0 Kudos

Yes, it is realy so.

REMOVE_ALL_CHILDREN destroy and Hand-made(no dinamically, static!) nodes too.