on 03-19-2008 1:23 PM
Hi All,
I'm having View in which datas are retrieved from the Database Table and display it in the View.
In the View i'm having one Table where i can enter values and save it in the Database.
After Clicking the Save Button the Datas will get stored in the Database Table.
I want the Page should get refreshed and it should display the latest value also.I written the Codigs for retrieving datas in the DOINIT.
Pls Help me in this Issue.
Regards,
Padmam.
Hi Padmam,
If you use supply function means using Invalidate method you can refresh your node.
But you used Doinit for fill the context node. So the problem is the doinit method called at only one time. So you cant execute the method again.
I found one solution. Please try it.
After pressing the save button, you have to write the select querry again. Before that you should populate your new data's to your table.
So using select querry and bind_table method you can add your latest data's to your context node.
Im not sure about this procedure. It may reduce the performance of your application.
Try to use supply function for filling the data otherwise you can try this also.
Thanks.
Edited by: Viji on Mar 19, 2008 3:05 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Padmam,
If you are using Supply function means the Invalidate method is working fine.
Check this sample code. Here manually I passed the values from method to DB table.
DATA:
node_node1 TYPE REF TO if_wd_context_node,
elem_node1 TYPE REF TO if_wd_context_element,
stru_node1 TYPE if_refresh=>element_node1 .
* navigate from <CONTEXT> to <NODE1> via lead selection
node_node1 = wd_context->get_child_node( name = if_refresh=>wdctx_node1 ).
* get element via lead selection
elem_node1 = node_node1->get_element( ).
* get all declared attributes
elem_node1->get_static_attributes(
IMPORTING
static_attributes = stru_node1 ).
stru_node1-CARD_NO = '12345679'.
STRU_NODE1-CARD_TYPE = 'GOLD'.
stru_node1-CUS_NAME = 'VIJAY'.
STRU_NODE1-CUS_CITY = 'SALEM'.
stru_node1-CUS_TEL = '9944241815'.
STRU_NODE1-CREDIT_LIMIT = 30000.
STRU_NODE1-AVIL_BALANCE = 20000.
INSERT INTO ZVIJI_CREDITCARD VALUES STRU_NODE1.
IF SY-SUBRC EQ 0.
node_node1 = wd_context->get_child_node( name = 'NODE1' ).
elem_node1 = node_node1->get_element( ).
node_node1->invalidate( ).
ENDIF.
Thanks.
Edited by: Viji on Mar 19, 2008 4:00 PM
Hi,
The supply function will implicitly be called only once. To refresh the contents, invoke the supply function again explicitly, in the 'Save' event handler.
This basically amounts to retrieving the data from the DB table and binding the contents again explicitly.
Hope this helps.
Regards
Wenonah
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.