cancel
Showing results for 
Search instead for 
Did you mean: 

i want to access data in a view to comp controller .

Former Member
0 Kudos

i want to access data in a view to comp controller with out using UI element in View . how can i achive that sample code please

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hey!

Good solutions already provided above. I'll try to summarize what you can do there:

- Use context mapping from view controller to component controller (for required node) - mostly appreciated scenario. So, in code you will have ability to refer to this data using view controller's wdContext object.

wdContext

- Directly refer to component controller's context using component usage

wdThis.wdGet<controller_name>().wdGetContext();

- Use some "getters" controller's methods if you don't want to deal with context

wdThis.wdGet<controller_name>().<getter_method>();

Also, we can provide more information if you add more details regarding the problem.

Thanks, Mikhail.

Former Member
0 Kudos

Hi

1.I think u have write a method in the Component controller lets say A()

2.Lets write a bean class (contans getter and setter method )in the src folder of Navigator exlorer.

3.In the view create a object of that bean class and trying to call in view controller

syntax:wdthis.wdget<urcontrillername>.A();

Former Member
0 Kudos

Hi Jaya,

Can you provide the more details of the problem or the scenario?

Regards,

Sukalyan

former_member214651
Active Contributor
0 Kudos

Hi,

If u want to access the data from a view from the controller, try doing a context binding between the view and controller. The value flows from view - controller and vice versa,

Regards,

Poojith MV

Former Member
0 Kudos

if I want to chang useid.

public void wdDoInit()

{

//@@begin wdDoInit()

String usrid = "BEN.CHEN";

String werks = "";

Zben_Demo_Rfc_Input rfc = new Zben_Demo_Rfc_Input();

Zben_Demo_Rfc_Output back = new Zben_Demo_Rfc_Output();

back.setR_Matnr("1100");

rfc.setP_Matnr(usrid);

wdContext.nodeZben_Demo_Rfc_Input().bind(rfc);

try{

wdContext.nodeZben_Demo_Rfc_Input().currentZben_Demo_Rfc_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

werks = wdContext.nodeOutput().currentOutputElement().getR_Matnr();

werks = werks + "abc";

back.setR_Matnr(werks);

wdContext.nodeOutput().bind(back);

} catch (WDDynamicRFCExecuteException e) {

wdComponentAPI.getMessageManager().reportException("Error"+e.getMessage(),false);

}

//@@end

}