on 03-28-2007 10:20 AM
Consider the following situation
View1 -
>View 2
view 2 has a tabstrip - > Tab1 and Tab2
Each of these tabs has a view embedded in them.
Tab1--->view 3
Tab2---> view 4
both View 3 and View 4 have their own elements and a viewcontainerUIelement each, and so each of them has another view embedded in them.
view3 ->view 5
view 4 -> view 6
Thus, effectively, views 3 4 5 and 6 are visible when view 2 is visible.
View 2 has a button to go back to view 1.
Is it possible to clear all the data on the views 3 4 5 and 6 when this back button is clicked. And subsequently, the views should be initialized again when the view 2 is opened from view 1 again.
Could anyone tell me how to achieve this functionality?
regards,
Priyank
Message was edited by:
Priyank Jain
Hi Priyank,
One of the ways could be that you fire an event OnAction 'Back' and clear the context attributes. I am not suggesting you to demolish the reference and create fresh views everytime because it would eat time in rendering the views to HTML format. But if you make use of Events then it will be a one time effort and you will just be clearing the data.. without destroying the UI controls/elements.
Regards,
Anoop
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anoop,
Thanks for the response.
I do have an event Onactionback when i click the back button to go to the view 1.
At this point of time, i have to clear the attributes of the four views. how do i clear the data of one view from another. More so, once i come back again to the view2, will the WDDOINIT be fired again? I am fetching the data in these views in the do init method. If this is not so, then how do i get the updated data in views 3 4 5 and 6 each time i open view 2. In the do init method of each view, i am calling some RFCs and then another view method to fetch the data.
I have come to know that calling a view method from another view is not possible. So i m looking for other options. I hope I am able to explain my problem well.
regards,
Priyank
Hi Priyank,
Let me try to address the issues one by one.
Clearing data of other views should not be a problem if you have nodes at component controller level or else you can fire event for each view at component controller level and handle it in view.. you may raise one event for each view(in case of nodes local to view).
And as far as loading of data is concerned then the moment you call view2 from view1 then the action triggering this process can fetch the data for you instead of the WDDOINIT of view2.. right ??
I hope this helps.
Regards,
Anoop
Hi Priyank ,
create a component A with view 1 and a view containter .
create a separate componentsay 'B' for view 2 .
In view1's component create a dynamic usage of the 'B' component and create this 'B' component whith the help of class : CL_WDR_COMPONENT_USAGE method create_component() in click of some button for eg create.
instead of creating back in view 2 create in view 1 , and on action if this ... get the active component usage of B component and destroy it ...
when u again click create button for eg creae in view 1 again a new component is created for B this way all the values will be refreshed ....
Hope this will help u ...
Regards
Yashpal
Message was edited by:
Yashpal Gupta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Priyank,
I think its not possible ..... even though if there are some navigation in view ..if view becomes active again in the same lifecycle of component the default view is not refreshed so the best possible way is to destroy the used component and again create a new one.. as it will be new one .. it will have all the data initialized ,,
Regards,
yashpal
Hi Anoop,
I can do the data fetching in the action triggering process but the problem is that i also have the code for ALV column settings (making columns editable, enabling append rows and delete rows) in the do init method of the view. I tried to leave this alv settings code in the do init method and do the data fetching on the click of the button on the previous view. It works fine when i navigate to the view for the first time but when i go back and then again come to this view, i can see only a single column in the ALV. Where should i write the code to handle the ALV in this scenario?
any hints???
regards,
Priyank
Hi,
you could add inbound plugs to those views and bind them to an outboundplug in
your main, this plug is fired in the onactionback, so you will navigate to the views
grtz
Koen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.