on 11-24-2008 10:32 AM
Hello,
I have a webdynpro application which is the typical table maintenance. The application has two views: one called searchview with a set of search fields, and the other one called resultview with an alv which shows the table registers, according to the search terms in the searchview.
In addition to this, resultview has also buttons for edit/visualization mode and a save button, and also processing logic to show a modal windows so when the user changes from edit to visualization a popup window appears asking to save the changes.
Now I want to modify the search button (in the view searchview) so when the user push this button if the alv has information on the screen and changes made, the system shows a popup asking to save the changes. My idea is to call the savechanges method in the resultview since I don't want to write the same code twice.
But my proble is that the search button is in the searchview, and the processing logic is in the resultview, so how can I call a method of a view from a different view? (how can I call resultview's method from searchview?)
Hi,
Maintain your context in the global component controller and map it to your local views. Maintain a method in the component controller of the webdynrpo component and you can access your method with the following syntax from across views:
call method wd_this->your_method().
Shruthi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
thanks for your answer but now think in the opposite way. If I'm in the component controller and I want to access data in the view, how can I do that?
Imagine for example I want to access to the view's context from one of the methods in the component controller, is this possible?
Regards
Edited by: Javier Arboleya Gomez on Nov 25, 2008 5:49 PM
Yes, define the context in component controller and then mapp it to view context. In the view controller you can set your context. Once the context is set and its' defined at component level. Then it can be accessed by any other view inside that component and also insdie the component(as in ur requirement)
Hi,
but what if I want to access the context of one of the views from the component controller, I´ve seen in the documentation about the possibility of creating in the component controller's context nodes as a copy of the nodes in the views. Is this the right way to access the context of a view from the component controller?
Regards,
Hi Javier,
Create the coding for the search method at component controller level instead of view level. This way the coding would be available for you across your views.
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
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.