on 04-01-2011 10:34 AM
Hi,
Is it possible to call View method from 'Z' class so that I can modify some attributes of element (using view context)??
Though it is not a good idea , because when you set the view property life time to 'when visible' the view instance will go for garbage collection.
you can save the view instance to the wddomodifyview view parameter to the component/view controller attribute and pass this instance to the class method for your further processing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ankit,
There is no way you can call a view method from a zclass or also from its component class or from anywhere as views are meant to be private in nature and there wont be access to any of view's elements and main point here is generally for performance issues write your methods in component controller and call from view.
Instead there is other way you can call a method into zclass,'create a customized class with method in the component and call it else create a custom method and change its required attributes in your current class'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks everyone for your suggestions.....
points awarded!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kuldeep,
thanks for response, if you check WDR_TEST_UI_ELEMENTS application - in it everything is controlled from assistance class........I want to change 'progress indicator' element value based on processing in class so that user is aware of program in running state (something very common in R/3 programs).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You shouldn't need access to view to do this. When you call the method of the class, have it return or export the value in question. Then in the surrounding controller code, use that value to update the context bound to the UI element.
You want to have a nice separtion of the layers in your application. If you start passing around the view reference you run into technical problems as well as messing up the layering effect.
Hi Ankit
Calling a view method is not possible i think.
But You can make a assistance class for your WD component and then you can call your method in view , perhaps you can write the code to be changed in method of assistance class and then can modify it according to your need.
regards
Kuldeep
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ankit,
As far as I know, you can not access any view method directly. As views are generally not visible to outside component.
However, you can call Z class methods from view controller.
Regards
Abhinav
Edited by: Abhinav Sharma on Apr 1, 2011 3:16 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.