on 09-29-2005 11:27 AM
wdDoModifyView javadoc recommends to use a static variable of view controller (VC) to pass/publish a references of UI elements to event handlers of VC.
it means then that different instances of VC serving different users share same static variable... i see here a problem, do not you?
P P: How do you come to this conclusion?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Armin Reichert: see TJA311 WebDynpro Part 1 Unit 10, example optional 1 solution 6-3,6-4 -))
my new conclusion is that any UI elements should only be access in wdDoModifyView method
the javadoc discourage from using instance fields not static fields but recommends not to use UIs outside of the method:
Hook method called to modify a view just before rendering.
This method conceptually belongs to the view itself, not to the
controller (cf. MVC pattern).
It is made static to discourage a way of programming that
routinely stores references to UI elements in instance fields
for access by the view controller's event handlers, and so on.
The Web Dynpro programming model recommends that UI elements can
only be accessed by code executed within the call to this hook method.
Hi PP
The Web Dynpro programming paradigm can take some getting used to, especially if you are coming from the world of, say, JSP.
Unless your UI absolutely cannot be defined at design-time, there should almost never be a need to write code in the wdDoModifyView method.
Web Dynpro attempts to completely seperate UI from data. So, in your example, you would create 10 buttons, and 10 labels. Each label would have its "Text" attribute linked to a String attribute in the view context. Each button would call an "onClick" handler which would change a particular context attribute, and that change will be reflected automatically by the label which is linked to it.
If you have a specific problem you are trying to solve, I will be glad to try and help you.
Regards,
Walter
Hi P.P,
Please read the commented statements before the wdDoModify() method.
<b>* It is made static to discourage a way of programming that routinely stores references to UI elements in instance fields for access by the view controller's event handlers, and so on.</b>
As the statement says, you are very much discouraged to pass references from & to wdDoModify() method. This is my understanding of the statement.
Best Regards,
Nibu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.