cancel
Showing results for 
Search instead for 
Did you mean: 

view data not getting refreshed

Former Member
0 Kudos

Hi All,

1. I have two views in my application.

2. The first view has some fields for searching a certain item.

3. I call a BAPI for this search. The search result gets populated in the fields of the bottom view.

4. I can update the fields i the bottom view, and the update works perfectly.

5. Now if after update, I press the search button again from the top view, the bottom view displays the values before updation. Which is the point of botheration for me. I am executing the search BAPI again, then why the old values are getting populated? If I refresh the whole page and start searching from scratch then proper updated values are displayed.

What I feel somewhere the values before updation are getting cached, which I cant figure out. Can anybody help.

Thanks in advance

Regards,

Shubhadip

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ghosh,

Each and Everytime , just before Execution of the Bapi,You have to invalidate your Node.Otherwise the nodeand Attribute will contain the old Values.

Try this.If Its not working I'll try to help you in someother way.

Thankx,

Karthick

Former Member
0 Kudos

Hi Karthik,

after execution of one BAPI, I invalidate the Output node. Do you want me to invalidate the same node even before the execution? Or you want the whole input node (including the output node) to be invalidated?

Please suggest.

Regards,

Shubhadip

Former Member
0 Kudos

Hi Ghosh,

That depends on the binding of your input.

You just tell me how you are binding your input to your Bapi?

After Changing your input (for updation) Are you setting it to the same node and Are you binding the Latest Value as input or the old Values are there in the input?Check these things.

Thankx,

Karthick

Former Member
0 Kudos

Hi Karthik,

in the first view I execute the BAPI and in the second view I show the results. In the second view I also submit the modified data via another BAPI.

As I execute and display result of same BAPI in two different views I have bound the same model node to both of these views. Let me give you some sample code for understanding what have I done.

In the first BAPI's search action handler I have written:

Zsr_Packnr_Validate_Components_Input input = new Zsr_Packnr_Validate_Components_Input();

wdContext.nodeZsr_Packnr_Validate_Components_Input().bind(input);

input.addT_Version(new Zsr_Packnr_Field_Values());

input.addT_Zsr_Genbr(new Zsr_Packnr_Field_Values());

input.setZsr_Gmc(globalMaterialCode);

input.setZsr_Mrc(mrc);

input.setZsr_Ctry(country);

input.setZsr_Dc(distributionChannel);

input.setZsr_Div(commercialSegment);

wdContext.nodeOutput_Validate().invalidate(); //as u suggested

wdContext.currentZsr_Packnr_Validate_Components_InputElement().modelObject().execute();

wdContext.nodeOutput_Validate().invalidate();

In the second BAPI I just display the output node from the same Model context node (its mapped to the second view too).

But as I said whenever I update some values in the result set and submit it the data gets submitted properly. But when I press the search button again, the previous set of data gets populated, not the just updated data.

If anybody has some idea on why the second time search BAPI execution still shows the previous set of result it will be a great help to me.

Thanks for all your help.

Shubhadip

Former Member
0 Kudos

Hi Ghosh,

1.I think from View you are directly connecting to the Model Node,which is not the correct way.

2.your Model Node should Bound with the model Seperately.

3.And The same Structure of Model Node,You should Have the Value node in Different Name.

4..Then Copy From Model Node to value Node by Using WDCopyService.copyCorresponding(elemSrc,elemDest) method.

5.While copying from model Node to Value Node you have to Invalidate your Value Node.

6.Your view must always bind with the Value nodes and attributes.

7.Actually this is the proper way of executing the Bapi.

8.And No need to invalidate the output node after executing the Bapi as you did.

9.bcaz you bind your view to the model node and if you are invalidating after bapi execution how the output value will be remaining?

Regards,

Karthick

Former Member
0 Kudos

Hi Ghosh,

Sample code for copying from model node to Value node.

int sizeAccAss = wdContext.nodeE_Activity_Table().size();

wdContext.nodeOutput_Project_GetInfo().invalidate();

wdComponentAPI.getMessageManager().reportSuccess("sizeAccAss - " + sizeAccAss);

for (int i = 0; i < sizeAccAss; i++){

wdContext.nodeE_Activity_Table().setLeadSelection(i);

elemSrc = wdContext.currentE_Activity_TableElement();//model

elemDest = wdContext.createOutput_Project_GetInfoElement();// value

WDCopyService.copyCorresponding(elemSrc, elemDest);

wdContext.nodeOutput_Project_GetInfo().addElement(elemDest);

wdComponentAPI.getMessageManager().reportSuccess("network " + i + " " + wdContext.currentOutput_Project_GetInfoElement().getNetwork());

}

Former Member
0 Kudos

Hi Ghosh,

Try to solve your problem by suggested way. And let me know.

Thankx,

Karthick