cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between View Context and Component Context

Former Member
0 Kudos

Hello All,

I am new to Web Dynpro. I have doubt in the "Context" concepts. Can anybody explain the "Context" concept and also the difference between View Context and Component Context. If possible, please explain me with some examples.

And also, do we have any related "Context" concept in ABAP or Java?

Priya

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

HI Priya

Do close your BSP Thread

With proper Reward points --It will encourage people to solve your problems..

Cheers:)

Mithlesh

Former Member
0 Kudos

Hi Priya,

The controller 'C' part of MVC in Web Dynpro is represented as follows:

Controller = context + custom code.

The context is the hierarchical data storage of the controller. Context stores the data temporarily which can be used by custom code.

Now the controllers are divided in to two

1. Controllers with a interface - View Controllers

2. Controllers without a interface - Custom Controllers

In the custom controller, there is a special type called Component controller. Now the context of view controller is called View Context and the context of component controller is the Component context.

Component's context can be used across the whole web dynrpo component(across all views). Where as view controller's context is used only for the view.

RK

Former Member
0 Kudos

hi

I exactly understood the explanation but I got 1 doubt .What is this view controller.Is it different to component controller.As per my knowledge, when we create a component then Component controller gets created by default.and for custom controller we have to create it.What about this view controller ?In studio also we cant see it explicitly.Please explain it?

Former Member
0 Kudos

Hi Priya,

Whatever data that you are using in view or controller you can store it in context.

Every view has its context. View context is for storing data pertaining to a particular view.

There is no context for component itself. You may have mentioned about controller context.

whatever global data is there you can store and access this from controller context. Those views that add the controller as used controller can access its context. Thus controller context can be used to store common data between views.

See this link for more details

http://help.sap.com/saphelp_nw04/helpdata/en/eb/e1cb5eea012b4481f8077c6023a70e/content.htm

Hope this helps you

Regards

Rohit

Yashpal
Active Contributor
0 Kudos

Hi Priya,

as webdynpro follows the MVC(model-view-controller) Pattern context is the model where u store data which is used by controller to manipulate and by view to display .

difference between view context and componenet is just like local and global variable . component controller may contains data which can be shared by many view and controllers but view contains data for its own use .

i hope it will clear some doubt and i didnt get ur last question

do we have any related "Context" concept in ABAP or Java?

please post it in some detail.

Regards,

yashpal