on 05-02-2008 6:06 AM
I have many input nodes related to function modle input in my view controller.
This input nodes are used to send collection of objects(function module custome types).
At present i am using
1. INVALIDATE to clear the data in my function module output.
2. RESET for context.
BUT what is the best waay to clear the input model nodes.
In my current application i suspect the data is reatined in import parameters in context.
What is best way to clear the input nodes.
Is there any other alternative to below code ?
-
int nGroupRecords=0;
nGroupRecords=wdContext.nodeImportParameterGroupRecords().size();
if(nGroupRecords>0){
for (int i = nGroupRecords; i > 0; i--){
wdContext.nodeImportParameterGroupRecords().removeElement(wdContext.nodeImportParameterGroupRecords().getElementAt(i-1));
}
}
make Lifespan of view controller to when_visible
nikhiL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi raghu,
The method invalidate() works differently for modelnodes and valuenodes. The method invalidate() makes empty value nodes only.
For model nodes invalidate() refreshes the data but don't make them empty. You have to explicitly make them empty
like
for (int i = node.size(); i > 0; i--)
node.removeElement(node.getElementAt(i - 1));
Yes, for each node, you need to use invalidate() method.
If you have a parent node having 10 child nodes, in that case only you can invalidate all by saying
wdContext.node<Parentnodename>().invalidate();
this will nuliify all your child nodes...
hope this will resolve your query
regards,
amit bagati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Amit,
You mean INVALIDATE will should be used only for MODEL Nodes?.
So i need to use below code for all value nodes.
for (int i = node.size(); i > 0; i--)
node.removeElement(node.getElementAt(i - 1));
What about below code?
When we need to use this?
Does the below code will not work for both Value nodes and model nodes?
wdContext.getContext().reset(true);
wdThis.wdGetComponentController().wdGetContext().getContext().reset(true);
All the above options are unable to resolve my issue.
I have requirment of deleting a record in SAP from frontend(webdynpro).
The records are deleted in SAP for DELETE button action.
But the screen shows with previous data only.
Even though if i navigate to HOME page and come AGAIN to delete page the same records are shown in web page.where as record is not existing in SAP.
The same is reflected in DELETE WEB PAGE if F5(REFERESH Button in browser) button is clicked.
Is there a way to achive a F5 /Browser referesh in webdynpro ?
Hi,
Below is the sequence that is taking place.
1. Get the data from backend using some RFC and display it in a table.
2. Delete the record.
Now, the record is deleted from the backend but still visible in your Table. Is this the problem that you are facing?
If yes, then try adding one more step to the above mentioned steps.
3. Refetch the data after deleting the record as u do in the first step. Invalidate the output node.
Regards,
Murtuza
Edited by: Murtuza Kharodawala on May 5, 2008 2:33 PM
code is as per those steps only.
data will be refereshed calling function module for display.
Output node is invalidatid for data referesh of function moduule execution.
But in this display i get the OLD data in VIEW.
Commit and Rollback are done by seprate function modules.
Why the data is refereshed when coming to the DELETE PAGE from a link in EP or F5 REFERESH button.
HI Raghu,
simply you can do it by using bind().
as
wdContext.nodeImportParameterGroupRecords().bind(new ImportParameterGroupRecords())..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi raghu,
instead of removing elements of node,you can use invalidate method to nullify your node.
for your case, you can write following code:
int nGroupRecords=0;
nGroupRecords=wdContext.nodeImportParameterGroupRecords().size();
if(nGroupRecords>0){
wdContext.nodeImportParameterGroupRecords().invalidate();
}
In general,you can use the below mentioned code to nullify any node:
wdContext.node<nodename>().invalidate();
Note:for each node to nullify,you need to use invalidate method.
regards,
amit bagati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Amit,
Can we use invalidate for both input and output model nodes?.
For any nodes INVALIDATE can be used.
I am having 20 input nodes for each functionmodule and one output node.
So i need to use INVALIDATE for 20 times for all my input nodes.
Is there way to clear the ENTIRE DATA from ROOT CONTEXT NODE ?
i think you can try wdContext.nodeImportParameterGroupRecords().invalidate();
and once you invalidate you need to create new element and bind to it to accept new values
nikhiL
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.