cancel
Showing results for 
Search instead for 
Did you mean: 

invalidate( ) view A from view B?

Former Member
0 Kudos

I have view A and view B in a web dynpro. B is a popup. In the popup window i can add a row to a table which is shown in view A. Saving and closing view B I see the changes only after resetting view A (i do that with wd_this->invalidate( ).

My question how to call invalidate from the popup (b) so that i can see after the refreshed table in A?

I found some anwers here, but they were to abstract.

Can you maybe give me an example?

Regards

Ezi

Accepted Solutions (1)

Accepted Solutions (1)

Yashpal
Active Contributor
0 Kudos

Hi ,

Create a event in component controller , handle the event in view A means create a event handler in view A and write the code to invalidate in that.

fire this event in view B where u want ... this will solve ur problem....

Regards

Yashpal

mohammed_anzys
Contributor
0 Kudos

Hi

You mean portal eventing?

Tahnks

Anzy

Yashpal
Active Contributor
0 Kudos

no its a simple event firing and event handling concept ..

a view can call a method of component .. and event is just like a method

and a view can handle a event of a component ..

its not portal eventing .

Regards

Yash

Former Member
0 Kudos

hm, thanks first for your answers.

the problem is that i can't use the component controller.

the method invalidate is:

method INVALIDATE .

data: node_table type ref to IF_WD_CONTEXT_NODE.

node_table = WD_CONTEXT->GET_CHILD_NODE( 'RELEASE_TABLE' ).

node_table->INVALIDATE( ).

endmethod.

and uses therefore the context of its own view.

when i use the component controller i can't invalidate the table i think?

Yashpal
Active Contributor
0 Kudos

where is this invalidate method in view A or B ?

if its in view A .... then as u are handling the event in view A then u can call that invalidate method in that.

Message was edited by:

Yashpal Gupta

Former Member
0 Kudos

View A.

Yashpal
Active Contributor
0 Kudos

see the previous reply ....

create a event in component controller..

add a event handler method for the comp-event in view A

call the invalidate method in that

fire the event in view B

Former Member
0 Kudos

In view A I created now a method

method INVALIDATE_E

wd_this->invalidate( ).

endmethod.

which calls the necessary method.

[I declared INVALIDATE_E as EVENT in the COMPONENTCONTROLLER..]

The EVENT in the COMPONENTCONTROLLER has got the name INVALIDAT.

Now i try to call INVALIDAT from view B.

When I write in the action of B

wd_this->fire_INVALIDAT_evt( ).

it says the method is unknown, protected or private.

Former Member
0 Kudos

Hi,

to use that you just check the interface checkbox in the component controller.

then you can make use that in your views

Logically speaking you should not Fire the Event in the views it should be always in the Component Controller

Cheers

Former Member
0 Kudos

but how to call the event from the componentcontroller?

can i just write wd_this->invalidate( ) in the view?

I will give you a clear overview what i have now:

<b>View A)</b>

1. An event INVALIDATE with the used functionality, connected to the component controller

<b>ComponentController

</b> In Events:

Event = Invalidat | Interface = yes

No Method implementation (is that right?)

<b>View B)</b>

Here I have an Action:

method OnActionInvalidat

wd_this->invalidate( ). (Here i actually don't know what the code should be. Tried different)

endmethod.

Would be very happy if somebody gives me the right hint.

Former Member
0 Kudos

Hi,

if you want to trigger the event the code would be

wd_this->fire_INVALIDATE_EVT( ).

Hi you can follow the Following steps:

1. In the Component Controller Create a Event INVALIDATE and create a method(Event_trigger) in the Component Controller with the Code wd_this->fire_INVALIDATE_EVT( ).

2. In the View A When you press Any Button , you do the following thing

In the Action Handler method, call the Component Controller Method(Event_trigger) Wd_COMP_CONTROLLER->event_trigger( ).So by Doing this You will be calling the Component ContRoller method which inturn will be Triggering the Event (INVALIDATE).

3.In the VIEW B you create a method of type Event Handler and in the Event Column press F4 and select the Corresponding event you created and inside this method you write the code what you what to do.

Let me know this is what you are expecting??

cheers

Answers (1)

Answers (1)

Former Member
0 Kudos

<b>Thanks to all!

Finally it works :)</b>