on 04-24-2013 3:29 PM
Hello guys,
I have 3 views and only one window in my component, I need determine wich view show be the "default view" during the initialization of the window.
This determination will depends of the role of the user that is acessing this component.
For example:
1 - reads the role of the user.
2 - The role is: "developer".
in the WDDOINIT, I need have something like this:
if role = 'developer'.
--- call view1
if role = 'admin'.
--- call view2
.....
Thanks,
Ricardo
Hi,
Lets say that you have two views V1, V2, V3. You would have embedded three of them in the same window. Create inbound plugs for each of these views. After that go to the window and create three outbound plugs. Create navigation links from these outbound plugs to the three different view inbound plugs. Then in the WDDOINIT method of the window, fire the appropriate outbound plug depending on the user role.
eg:
data : test type i value 1.
if test = 1.
wd_this->fire_to_v2_plg( ).
else.
wd_this->fire_to_v1_plg( ).
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ricardo,
What you can do is use the Dynamic Navigation. Create one view, lets call it Main. Embedd the view in the main window.
Now lets say you have two views - view1 and view 2. Embedd the these views in the same window.
Create an outbound plug in the main window TO_TARGET.
In the wddoinit of window you can write the below logic:
DATA: lo_win type REF TO IF_WD_VIEW_CONTROLLER.
lo_win = wd_this->wd_get_api( ).
if role = 'developer'.
lo_win->IF_WD_NAVIGATION_SERVICES_NEW~DO_DYNAMIC_NAVIGATION( SOURCE_WINDOW_NAME = 'MAIN_WIN'
SOURCE_VUSAGE_NAME = 'MAIN_USAGE_0'
SOURCE_PLUG_NAME = 'TO_TARGET'
TARGET_VIEW_NAME = 'VIEW1'
TARGET_PLUG_NAME = 'FROM_MAIN' ) .
if role = 'admin'.
lo_win->IF_WD_NAVIGATION_SERVICES_NEW~DO_DYNAMIC_NAVIGATION( SOURCE_WINDOW_NAME = 'MAIN_WIN'
SOURCE_VUSAGE_NAME = 'MAIN_USAGE_0'
SOURCE_PLUG_NAME = 'TO_TARGET'
TARGET_VIEW_NAME = 'VIEW2'
TARGET_PLUG_NAME = 'FROM_MAIN' ) .
Hope it helps. Thanks!
Regards
Abhinav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
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.