cancel
Showing results for 
Search instead for 
Did you mean: 

Table is not refreshing - View Navigation

Former Member
0 Kudos

Hello Experts,

In my WD application, there are two views : VIEW1 and VIEW2.

When I Click on 'Button1' from view1, it goes to the view2 using navigation plug. On view2, there are two buttons namely 'ADD' and 'Cancel' and one table(Items) .When user clicks on 'ADD' button, I am adding record to the table. and when user clicks on 'Cancel' button I am navigating back to the view1.

Before firing navigation plug to the view1, I am clearing the contaxt node binded to the Item table but still when I again press Button1 from view1, the records are present in the table (Items).

When user clicks on 'Cancel' button from view2, item table should be cleared so that when user press button1 (View1) again, he should see blank table.

Could you please help me finding the reasons behind this behavior?

Thanks,

Prashant

Accepted Solutions (1)

Accepted Solutions (1)

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Hope you get records from database table.

After you add the contents/cancel the contents, are you updating the database table also?

Former Member
0 Kudos

Hi Jayanthi,

I have not at all touched database yet. I am adding records in a table with scrrenvalues only. I am adding contents only to web dynpro table, not database.

Thanks,

Prashant

Former Member
0 Kudos

Hallo prashant,

View2 has its own context, no context mapping with controller (and view1 context ).

View2 -> table binded to context node. On cancel event how do you clear the node ? are you binding a empty table to the node ?

gill367
Active Contributor
0 Kudos

How are you clearing the code . can you paste the code here ..

and where are you clearing it .

you need to right the code for clearing the table in the on click event handler of cancel button of view 2 or you can also

write it in event handler of the inbound plug of view 1 when it comes from view 2.

thanks

Sarbjeet Singh

Former Member
0 Kudos

Hi Baskaran,

Yes, View2 has its own context, no context mapping with controller (and view1 context ).

I am binding the empty table to the node. (Context node of the view2 only)

Thanks,

Prashant

Former Member
0 Kudos

Hi sarbjeet,

I am clearing it on the click event handler of cancel button with following code


  DATA: lo_nd_zitemtable TYPE REF TO if_wd_context_node.
  DATA: lo_el_zitemtable TYPE REF TO if_wd_context_element.
  DATA: lt_zitemtable TYPE TABLE OF z1063f.

  lo_nd_zitemtable = gr_view_context->get_child_node( name = 'ZITEMTABLE' ).
* get element via lead selection
  lo_el_zitemtable = lo_nd_zitemtable->get_element( ).


  lo_nd_zitemtable->get_static_attributes_table( 
                               IMPORTING table = lt_zitemtable ).

  CLEAR lt_zitemtable.

  lo_nd_zitemtable->bind_table( new_items = lt_zitemtable 
                       set_initial_elements = abap_false ). 

Thanks,

Prashant

gill367
Active Contributor
0 Kudos

have you tried debugging and checked wt is happening.

it will give you the clear picture of table content bound to the context.

thanks

sarbjeet

Former Member
0 Kudos

Yes Sarbjeet,

I have checked in debugging, It is clearing the 'lt_zitemtable' successfully. I have checked values inside the 'lt_zitemtable' after the clear statement specified in above thread.

Thanks,

Prashant

Edited by: Prashant Jagdale (Genius) on Dec 24, 2010 5:21 PM

Former Member
0 Kudos

Hallo Prashant,

have you tried changing the set_initial_elements = abap_true ?. This should do the trick

gill367
Active Contributor
0 Kudos

yup i also think

changing that parameter will do the trick...

otherwise it will just add to the elements already existing

Answers (1)

Answers (1)

sahai
Contributor
0 Kudos

hi,

you can use the invalidate property of IF_WD_CONTEXT_NODE to refresh the node only refreshing or clearing the internal table wont do.

so first you create an object for IF_WD_CONTEXT_NODE and using that object you can call invalidate. this will refresh your node.this thing is to be done in the coding of the cancel button.

hope this maybe precise and help you

thanks and regards,

sahai.s

gill367
Active Contributor
0 Kudos

Hi sahai,

he is trying to bind an empty table to node. that will also work.

how ever as you suggest invalidating teh node is also an option .