cancel
Showing results for 
Search instead for 
Did you mean: 

How to make wddoinit of a view run more than once?

siongchao_ng
Contributor
0 Kudos

Hi all,

I have View A and View B here. In View A, I have table and let user select a line of records in the table. Once user select a line an click execute, I'll bind the structure o the context and it will navigate to View B. In wddoinit of View B, I'll get the selected structure from the context. All these went okie for the first time.

Problem: If user in View B, click 'back' button to navigate to View A to select a different line of records from the table in View A, my wddoinit of View B wont be called this time around as it is called earlier. So I'll probably wont get the newly selected structure. How to get wddoinit of View B to run again? Can I destroy View B everytime user click 'back' to go to View A? How?

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Set the Lifetype property of the View to When Visible. That way when you return to view A, the instance of View B will be destroyed. Upon navigation back to View B, the WDDOINIT will fire again.

Answers (1)

Answers (1)

Former Member
0 Kudos

HI Siong Chao

WDDOINIT is called automatically when a controller is initialized for the first time after that doinit will not trigger

In you case you can do like this

View A - Pass your selected line as a parameter of Outbound plug

OB/ name -OUT_TO_VIEW2
              Parameter - TABLE_OUT type zpc_sflight.

      wd_this->fire_out_to_view2_plg(
        table_out =      table_str                   "Here pass your structure line 
      ).

view B - in inbound plug define paramater of same type & name

table_out  importing  ZPC_SFLIGHT

and now you can freely assign table_out to your structure

ls_node_view2 = TABLE_OUT.
    lo_el_node_view2->set_static_attributes(
       static_attributes = ls_node_view2 ).

Now every time you navigation from the view A to View B the above piece of coding will execute .

Regards

Chinnaiya P