cancel
Showing results for 
Search instead for 
Did you mean: 

Custom & Component Controller

Former Member
0 Kudos

Hi,

What is the difference between Custom & Component Controllers? In which situations we can use those controllers?

Thanks & regards,

Mastanvali Shaik

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

HI Shaik..

Hi,

Component Controller and Custom Controller are more or less the same. Both are related to a particular component in the webdynpro application you create.

<u><b>Component Controller:-</b></u>

For each component of yours there will be a component controller, were in you can define context variables and methods, events etc.. This usefull while using models.

Simple example where we can see this is, when you create global context variable in this controller and map this variable to the view controller context variable of different view, which enables you to pass the value of the variable from one view to another.

<u><b>Custome Controller</b></u>:-

They also have the same the function but as the name suggest there function can be customised. That is we can have more than one custom controller for a component. This is usefull when we need to create seperate execute methods for inputs from model import( Both webservice and rfc call).So you can seperate each other. Example is there in the more sample codes and application section.

<u><b>Interface Controller:</b></u>

There is only one interface controller for a component. It is mainly used when we need to communicate between two components.There is sample application for communication between two components in the sample codes and application section.

I think this is enough to get an idea on the difference between each of controllers.

Urs GS

Former Member
0 Kudos

Hi,

Component Controller

Special (default) custom controller which allways exists. Custom controllers have to be named and declared. and these controllers do not have any visual interface they inherit from the view controller during runtime.

Component Controller is a default one.We cant create any Component controllers.Where as we can creat a any number of Custom Controllers.

check the following tutorial which make use of custom controller

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/wd%20jav...

for other tutorials

https://www.sdn.sap.com/irj/sdn/webdynpro?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#15

If u want more details ,u can check this tutorial

Structural concepts of WebDynpro component

Regards

Surya

Former Member
0 Kudos

Hi Manstanvali,

You will get one component controller whenever you create a new WebDynro component.

The things you write in the component controller will be global within your application and can be shared by other views.

Custom controller behaves in the same way as default component controller but this provision is given so that you can compartmentalize your code and context in different component controllers.

Assume you are dealing with FICO and HR modules in your same WD Application.

One thing would be you can write all your code for both the modules in a single default component controller or the other thing is you can create two custom controllers holding their own data.

Behaviour of custom as well as default controller remains the same.

Regards,

Murtuza