on 03-23-2009 9:00 AM
Hi there,
Sorry If i have asked it before.. But I am not sure again
Lets say I want to clear a model node which is bounded to a model,
do I use:
wdContext.nodeTest().invalidate?
(Won't it simply just update the nodes with the result values from the model instead of clearing it?)
The scenario is like this.. I have some model nodes containing some value of previous result and I want to clear all these values when the user click on "Return to Menu".
Hi Jackson,
Yes you are right it will not delete the values instead it will take it to the initial state of when the model was executed.
Therefore most of time we prefer the model binded nodes and value nodes in combination if we require to do some tricks to the values of the feteched model.
I hope this helps..
Thanks and Regards
Pravesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I want to do the following:
When the user click "Back to Menu" (after everything was executed), all the model nodes will be empty so when he goes through the screens, there will not be any 'left over' values inside.
I am thinking of the couple of followings:
1. Rebind the model nodes so when user onClick "Back to Menu" button, all will be empty values.
2. Call Controller.wdDoInit() (Is it possible? Since all my model binding methods are inside)
Thanks for any advice!
Hi Jackson,
by your secind question you remind me of one of my projects I was handling earlier. I have similar requirement of calling the controller init method but dear unfortunately you should not do that and alos it is not possible. Against the Webdynpro framework architecture.
Webdynpro Framework automatically takes care of calling wdDoinit() of component controller.
This answers you 2nd question..
Regarding the 1st onde. I would suggest you to copy the model node value to the Value node as we have suggested to you in your earlier threads and then when you click on "Back to Menu" button just use the invalidate() on the value node.
Invalidate works on the Value node as deleting the values, but I guess you know it is not actually deletaing it is reinitialization of value node as well. But since there was no values in Value node in its initial state, so when you invalidate() it will remove all the node elements.
I hope this solves your issue!
Thanks and Regards
Pravesh
Hi Jason,
Just Delete the model instance at the end of the process
<Model> objModel = null;
try {
objModel =
(<Model> ) WDModelFactory.getModelInstance(<Model> .class);
objModel.disconnectIfAlive();
} catch (Exception e) {
IWDMessageManager msgMrg =
wdThis.wdGetAPI().getComponent().getMessageManager();
String msg = e.getLocalizedMessage();
if ((msg == null) || (msg.length() == 0)) {
msg = e.getMessage();
}
msgMrg.reportException(msg, true);
} finally {
objModel = null;
}
Do let me know if it works.
Cheers
Murali.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.