cancel
Showing results for 
Search instead for 
Did you mean: 

ViewSets

former_member1193316
Participant
0 Kudos

Hi,

In Webdynpro java, we r having a feature called 'viewset' for to dispaly different views in the same window.

in case of webdynpro abap, how to create viewset. i didnt seen any option for to create the view set.

could you please help me to work on view set.

thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

mohammed_anzys
Contributor
0 Kudos

Hi

As nitya said , You could use viewcontaier UI element , but the difference from the java is that , it could carry only one view....

Thanks

Anzy

former_member1193316
Participant
0 Kudos

In java v will hav sme empty views. here is there any empty view or smething like that.

coz in my top view there should be a button, wen i press that button another view should enable in the same window. how to do this.

Former Member
0 Kudos

In you context, you have attributes to denote the visibility of each view. The attribute type can be char01 or wdui_visibility. Bind the "visible" property of the view container element to the context attribute. By default, you could make all views invisible in the doinit method itself, so that only your button will be visible. In the onAction event of the button, change this attribute to true so that the view will become visible.

Hope this helps.

Regards,

Nithya

mohammed_anzys
Contributor
0 Kudos

Hi

Yeah , in ABAP also we have empty views .So that we could dynamically populated teh views.

Thanks

Anzy

Yashpal
Active Contributor
0 Kudos

Hi Venkat,

In WDJ for a window the view set is defined and then the views are embedded to that and there is a default view for every view set section . this feature is present in WDA in a different manner .u define a window and embedd a view inside that . for that view u can create elements which acts as a container for other view ( viewContainerUielement ) and u can align this container using the layout. in ur container element u can embedd the views u want and make a single as a default .

one advantage with this is that .. when u want to replace a view containing views as above with a different view u can easily fire a plug to new view .

Regards

Yash

former_member1193316
Participant
0 Kudos

could you please provide me the code how to enable or disable.

even i m having sme input feilds which all r in disable mode. when i click button all should be in edit mode.

your provided code will give more advantage to me. please

Former Member
0 Kudos

Ok. Declare a context attribute read_only. Bind this to the "read_only" property of your input fields (bind each field separately). This you should do by clicking on the button next to the read only property and selecting the attribute. In the context itself, for the attribute, set the default value as 'X', so that all input fields are disabled initially.

Then, you have a button with an action defined on it. Write this in the event handler.

data:

lr_element type ref to if_wd_context_element.

lr_element = wd_context->get_element( ).

lr_element->set_attribute(

exporting

name = 'READ_ONLY'

value = ''

).

This code assumes that the attribute READ_ONLY is directly under the context and not within a node. If you have it in a node, change the code accordingly. You can use the code wizard for this.

In a similar fashion, you could set the views as visible or invisible with context attributes. Revert for any clarification.

Regards,

Nithya

shwetars
Advisor
Advisor
0 Kudos

Hi Venkat,

by default when you create your component an empty view is created, however you can't view it under the list of views.

when you open the window and try to embed a view in the available options there is a view called Empty view.

thus u can use this to show an empty view initially.

have multiple views including the empty view within the window or the ViewContainerUIElement, set the empty view as default.

after the button click just fire an outbound plug to the other view within the button action handler.

hope you have a clear idea about firing of plugs.

Regards,

Shweta

former_member1193316
Participant
0 Kudos

Hi,

now i hav created an view, i added on viewcontainer ui element. but how to add ui elements to this container. there is no option to add ui elements to that container. then how to do

please tell me

shwetars
Advisor
Advisor
0 Kudos

Hi Venkat,

a ViewContainerUIELement holds only views and no other ui elements. This enables you to place multiple views in a single window.

thus to add ui-elements you need to first create a view and then put them in it. Finally you will have to embed this view within ViewContainerUIElement.

steps you need to follow:

1)create a view say "V1" and place a ViewContainerUIElement within it.

2)create another view say "V2" and place other ui-elements within it.

3)open your default window and emebed V1 within it

4)Expand V1 and there you can see the ViewContainerUIElement there, right click on that and embed V2.

similarly you can also embed an empty view within the ViewContainerUIElement and make it default. Only on some button click you can navigate to V2 by firing the approriate outbound plug.

Hope this clears your doubt.

Regards,

Shweta

PS: Award points for helpfull answers.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Venkat,

In Web Dynpro ABAP, you have something called a viewcontaineruielement. You could add any number of such elements to your main view and embed different web dynpro views to them. This way you have the concept of viewset in ABAP too.

Hope this helps.

Regards,

Nithya