cancel
Showing results for 
Search instead for 
Did you mean: 

refreshing frontend display

Former Member
0 Kudos

Gudday,

How can we refresh the frontend table values when new entry is added r existing entry is edited without refreshing it in the browser?

Awaiting your reply.

Thanks,

Deepthi.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member515618
Active Participant
0 Kudos

Hi Deepthi,

Could you be more specific about the requirement?

When the data is changes in a table, if the context node to which the table is bound is updated then data is refreshed automatically. If not, we have to manually update the context.

Regards,

Sravan Varagani

Former Member
0 Kudos

Hi Sravan,

I have list of education details in table as my first view fetched from database table using function module getlist.

In second view i have fields for new entry.If i save this values using another fn.module and press back button

it should display in my first view table ,without refreshing the browser.

I want the table to get refreshed automatically.Please reply if it is not clear yet.

Awaiting your reply.

Thanks,

Deepthi.

former_member515618
Active Participant
0 Kudos

HI Deepthi,

The frame work doesnt refresh the data automatically. If table UI element is bound to a context node it displays the data existing in that node.

We have to update the context with the refreshed data in order to display correct data. So for the selected/Changed educational records, get the data from the database table using get function module and bind it to the context. This ensures the consistency of data.

Do the above in the event handler of the plug called when back button is clicked.

Hope this helps.

Regards,

Sravan Varagani

Former Member
0 Kudos

hi martina.......

if you want to refresh the table to check for the new values....

then you can invalidate the node that is bound to the table using node-> invalidate(). method. it calls the supply function again and you can retrieve the values from the database.

---regards,

alex b justin

Former Member
0 Kudos

Gudday,

invalidate( ) is working only when i am editing the entries.When i create new entry and go back to the main screen it is not reflected in the main screen table.

Can you Please suggest ,how this problem can be resolved??

Awaiting your reply.

Thanks,

Deepthi.

Former Member
0 Kudos

hi martina.......

when you create it.....

after it is upadted....

call the invalidate method in the same method...

if you are creating it another view....

call teh invalidate in the inbound plug of the main view.

---regards,

alex b justin

Former Member
0 Kudos

Gudday,

Iam using same screen to edit and create .save button in next screen where i will review the entries,here i will call the create or edit fn.module and plug in to the next screen.

In the confirmation screen i read the context of int_table which is from getlist fn.module and invalidated it.

I called the getlist( ) fn.module after invalidating it.This is working if i edit.

I tried invalidaing in the main scren as u mentioned.It is throwing junk error.

Please suggest me how to proceed further.

Thanks,

Deepthi.

Former Member
0 Kudos

hi martina......

the invalidate method.... calls teh supply function again...

so it will again run eh select query and fill the table.

the cardinality must be 0..n.

once the data is created in the database... you should call teh invalidate method for the node so that it is displayed in the table...

if the save button is in the same view as the table is present.... then just call the invalidate method for the node that is bound to the table once the data is created....

if it is present in another view....

then you can use it in the wddoinit method iself.

---regards,

alex b justin

Former Member
0 Kudos

Gudday,

Please check the code below ...Is this the way to invalidate??

I didnt use supplyfunction concept here...

But this is refreshing if i edit the values....

Please suggest how to proceed further...

DATA lo_nd_z_rfc_emp_ed"_ge TYPE REF TO if_wd_context_node.

DATA lo_nd_changing TYPE REF TO if_wd_context_node.

DATA lo_nd_int_table TYPE REF TO if_wd_context_node.

DATA lo_el_int_table TYPE REF TO if_wd_context_element.

DATA ls_int_table TYPE wd_this->element_int_table.

  • navigate from <CONTEXT> to <Z_RFC_EMP_EDU0022_GE> via lead selection

lo_nd_z_rfc_emp_ed"_ge = wd_context->get_child_node( name = wd_this->wdctx_z_rfc_emp_ed"_ge ).

  • navigate from <Z_RFC_EMP_EDU0022_GE> to <CHANGING> via lead selection

lo_nd_changing = lo_nd_z_rfc_emp_ed"_ge->get_child_node( name = wd_this->wdctx_changing ).

  • navigate from <CHANGING> to <INT_TABLE> via lead selection

lo_nd_int_table = lo_nd_changing->get_child_node( name = wd_this->wdctx_int_table ).

  • @TODO handle not set lead selection

IF lo_nd_int_table IS INITIAL.

ENDIF.

  • get element via lead selection

lo_el_int_table = lo_nd_int_table->get_element( ).

  • @TODO handle not set lead selection

IF lo_el_int_table IS INITIAL.

ENDIF.

  • alternative access via index

  • lo_el_int_table = lo_nd_int_table->get_element( index = 1 ).

  • @TODO handle non existant child

  • IF lo_el_int_table IS INITIAL.

  • ENDIF.

  • get all declared attributes

lo_el_int_table->get_static_attributes(

IMPORTING

static_attributes = ls_int_table ).

lo_nd_int_table->invalidate( ).

DATA lo_COMPONENTCONTROLLER TYPE REF TO IG_COMPONENTCONTROLLER .

lo_COMPONENTCONTROLLER = wd_this->get_componentcontroller_ctr( ).

lo_componentcontroller->execute_z_rfc_emp_ed"_getl(

).

Awaiting your reply.

Thanks,

Deepthi.

Former Member
0 Kudos

hi martina.....

the invalidating is correct....

another suggestion is...

write the select query for filling the table in a seperate mathod and try calling that method whenever needed...

so that it gets updated....

but when you are doing with a table, supply function is the best to go with.

---regards,

alex b justin