cancel
Showing results for 
Search instead for 
Did you mean: 

Could not access model Binded inputfield

Former Member
0 Kudos

Hi all,

I created a model and mapped a node from model to component controller and then from component controller to view context. I am directly binding the the node attributes of the model to the inputfield. But they remain disabled. How to instantiate the model nodes?

The model is Bapi_po_create. The node is PO_Header.

Any help ll be appreciated ;>)

Regards

Rakesh.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try:


Bapi_Po_Create1_Input bapiPoCreateInput =
				new Bapi_Po_Create1_Input();

wdContext.nodeBapi_Po_Create1_Input().bind(bapiPoCreateInput);

Regards,

Satyajit.

Former Member
0 Kudos

Hi satyajit

I tried it but it didnt work. The input field is binded to co_code of PO_Header of the model. May be we should initialize PO_Header of the model. Any document related to this will also be very helpful.

Regards

Rakesh ;>)

former_member286976
Active Participant
0 Kudos

Hi Rakesh,

The reason could be that there are no elements (records) in the context node. Try changing the cardinality to 1..n or create element in the context in your wdDoInit() method. Hope this solves the problem.

Regards,

Sudeep.

Former Member
0 Kudos

Hi Rakesh,

You are right. The initialization should be like:


Bapi_Po_Create1_Input bapiPoCreateInput = new Bapi_Po_Create1_Input();

Bapimepoheader poheader = new Bapimepoheader();

//add values to poheader
//...
bapiPoCreateInput.setPoheader(poheader);

Bapimepoheaderx poheaderx = new Bapimepoheaderx();

bapiPoCreateInput.setPoheaderx(poheaderx);

//etc....Do this for all structures that are needed.

wdContext.node<BAPI input>.bind(bapiPoCreateInput);

//execute

Regards,

Satyajit.

Message was edited by: Satyajit Chakraborty

Former Member
0 Kudos

Hi Sudeep

The problem is solved. Actually the node PO_Header needed to be initialized and bind like this.

Bapiekkoc a = new Bapiekkoc();

wdContext.nodeBapi_Po_Create_Input().nodePo_Header().bind(a);

Thanks for all replies,

Regards

Rakesh ;>)

Message was edited by: Rakesh

Answers (0)