cancel
Showing results for 
Search instead for 
Did you mean: 

Which approach to choose to pass data between views

dhruv_mehta
Active Contributor
0 Kudos

Hi CRM Experts,

I have a working requirment to pass data between two views , i followed some wikis and they

stated to use component controller. Some use relationship of genil etc. Which of the approach is more reliable

and fast to develop. and how do i pass data between views with the help of controllers i have used only relationships

to get data. Help is appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Dhruvin,

Through relations, you can get only GENIL buffer data.  Through this you can't  get BOL Buffer data. and also U can't access any value node data.

Better to use any global controllers(window, Custom controller or component controller) context nodes as data containers.

Note: Don't forget to bind view nodes to Container nodes.

Regards

Vijay

dhruv_mehta
Active Contributor
0 Kudos

Hi Vijay thats a great help... thnks but can u plz explain howo do i use global containers . And how should i decide that i should use which type of controller?

Former Member
0 Kudos

Hi Dhruvin,

It's quite simple.

You have to chose a global container according to data sharing need.

If you want data share bitwee two views witch is under same window, U can use either window, Custom controller or component controller.

If that views are not belongs to same window, the you should use Custom controller or component controller and If any case you want to data share among components, You should use Component Controller.

Regards

Vijay

dhruv_mehta
Active Contributor
0 Kudos

Hi Vijay thnks for replies. Can u plz show me how do we achive that? as in some step by step answer or link to some wikis or so? i tried to find did not find a wiki of mu need

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Once the custom controller is created we need to link this custom controller in the views so that the data will be available to all views that are linked together. See the following screen shot.

custom-controller-01

Once you clicked on the create you will get a pop up wizard that will take you thru the process. Let us name the custom controller as TestCuCo. See the following screen shot.

custom-controller-02

Let us go to the next screen and add the Model node. Let us add a Model node and tie that node to the custom BOL.

See the following screen shots for the Custom controller creation. The whole process is like creating the view.


custom-controller-03

I added tow Model nodes. I will be using this two nodes to pass data between two views, where I will create a link while creating the view for that particular node. Now let us go and add the attributes for these nodes. Skip the next screen and go to Add Model Attributes. See the following screen shot.

custom-controller-04

Click on the + sign and add the fields that you want. I added all the fields for each node. Let us click continue all the way and complete the process. Now our custom controller is ready for use.

Check this..

Regards

Vijay

dhruv_mehta
Active Contributor
0 Kudos

Hi Vijay Thank you so much for your effort it really helped me!!

by the way now i need to bind my context node to this cu. co right?

and how will code to get that data in my another view or do i just need to bind it on the other view's context node as well?

Former Member
0 Kudos

HI Dhruvin,

You will need to bind the context node now. Bind the context node of the view 1 with the custom controller. and then in the view2, u can read the values from the custom controller using

lr_cuco ?= me->get_custom_controller( '<custom controller name>') .

And then access the relevent context node and read the required attribuites.

Hope this helps!!!

Prerna

dhruv_mehta
Active Contributor
0 Kudos

Hi Prerna , Thanks a lot for the info. I tried that and worked!!!

Former Member
0 Kudos

Hi Druvin,

You are trying to compare two completely different approaches. If you want to pass the data between views the standard approach would be using custom controllers provided both views are under same component. You can do binding between them which ensures you are working with same instance of collection in all context nodes which are bonded .

Reading from Genil no where comes into pictuire for passing data between views .

Regards,

Nithish

dhruv_mehta
Active Contributor
0 Kudos

Hi Nitish Thanks for reply.  Can you help me how do i use custom controller to pass data between two views?

Help is appriciated...

Former Member
0 Kudos

hi,

For communicate through custom controller , firstly you have to create custom controller then after you have to create context node which has same base entity to whom you want to bind, then after you have to bind this custom controller's context node. Now context node is ready you can set and get data from custom controller's context node.

Regards,

Vivek Gupta

Former Member
0 Kudos

Hi,

follow this link http://techskills.wordpress.com/tag/sap-crm-context-node/

Just go through this link for Custom controller Context nodes

http://scn.sap.com/people/vikash.krishna/blog/2009/12/28/crm-70-how-to--5d-custom-controller-and-bin...

And also see the billow wiki for understand. Ignore technical details.

http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=201066680

Regards

Vijay