‎2007 Mar 22 7:51 AM
Dear Ladies and gentleman,
i have a problem with updating/refreshing a simple tree (cl_gui_simple_tree).
Situation:
when i start my 'tree-dynpro' the first time, the tree is displayed correctly. But the tree can be extended by the user via clicking a button 'create new node' e.g.. Therefore a new dynpro will be opened where the user can fill in new data. after clicking the 'save'-button the new entry will correctly stored in my database. and my node-table is also correctly built with the new entry. but my tree doesn't show the new entry. i have to close my program and restart it to view the changes. how can i refresh the tree in realtime without restarting my whole program.
Thanks a lot for your help,
Marcel
‎2007 Mar 22 10:41 AM
Hello Marcel
The sample report<b> BCALV_DND_01</b> shows how to add nodes to the tree using <i>Drag&Drop</i>.
In your scenario when the user pushes the CREATE button your application handles the user-command at PAI of the dynro including the adding of the new node to the tree.
In this scenario PAI is followed by PBO of the dynpro where the flushing should occur automatically.
However, if the push button is part of the toolbar then PAI is not passed. In this case you may try the following trick:
(1) Add the following coding to the method handling the user-command:
... " add node to tree
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'REFRESH' ).
" NOTE: this will trigger that PAI of the dynpro is passed(2) Add the following coding in the <b>PAI </b>module handling the user-commands of the dynpro (e.g. USER_COMMAND_0100):
case gd_okcode.
WHEN 'REFRESH'.
CALL METHOD cl_gui_cfw=>flush( ). " flushing
WHEN ...
endcase.Regards
Uwe
‎2007 Mar 22 10:41 AM
Hello Marcel
The sample report<b> BCALV_DND_01</b> shows how to add nodes to the tree using <i>Drag&Drop</i>.
In your scenario when the user pushes the CREATE button your application handles the user-command at PAI of the dynro including the adding of the new node to the tree.
In this scenario PAI is followed by PBO of the dynpro where the flushing should occur automatically.
However, if the push button is part of the toolbar then PAI is not passed. In this case you may try the following trick:
(1) Add the following coding to the method handling the user-command:
... " add node to tree
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'REFRESH' ).
" NOTE: this will trigger that PAI of the dynpro is passed(2) Add the following coding in the <b>PAI </b>module handling the user-commands of the dynpro (e.g. USER_COMMAND_0100):
case gd_okcode.
WHEN 'REFRESH'.
CALL METHOD cl_gui_cfw=>flush( ). " flushing
WHEN ...
endcase.Regards
Uwe
‎2007 Mar 22 3:52 PM