cancel
Showing results for 
Search instead for 
Did you mean: 

Easy: Initialize context nodes

Former Member
0 Kudos

People.. please... I need to create new elements in the node "T_Saida" but I don´t know how to do, because it is inside one tree.

Can anybody tell me how can I initialize each node ir order to create new elements at T_Saida ?

The Context:

Zctftv003_Input (node)

OutputSolicitacao (node)

T_Saida (node)

Atribute1

Atribute2

Atribute3

Atribute...

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

It worked, thanks for the very helpful answer, the code is this:

IPrivateTransporteAlojamentoView.IZctftv003_InputElement elementZ = wdContext.createZctftv003_InputElement( new Zctftv003_Input() );

elementZ.setV_Pernr("3");

elementZ.setV_Reinr("0");

elementZ.setV_Botao("OF");

wdContext.nodeZctftv003_Input().addElement(elementZ);

IPrivateTransporteAlojamentoView.IOutputSolicitacaoElement elementSol = wdContext.createOutputSolicitacaoElement( new Zctftv003_Output() );

wdContext.nodeOutputSolicitacao().bind(elementSol);

IPrivateTransporteAlojamentoView.IT_SaidaElement elementT = wdContext.createT_SaidaElement( new Zctts001() );

wdContext.nodeT_Saida().addElement(elementT);

Former Member
0 Kudos

Hi,

Please check the link that I have provided in the previous posting.

I hope it will help you

Former Member
0 Kudos

what about the context tree ?

this is the tree:

Zctftv003_Input (model node)

-

-


OutputSolicitacao (model node)

-

-


T_Saida (model node)

-

-


Attribute1

-

-


Attribute2

-

-


Attribute3

-

-


Attribute...

don´t I have to initialize each node ?

Former Member
0 Kudos

Hi,

You can create a new element of the node by using following code:


IPrivate<View Name>.I<Node Name>Element element = wdContext.create<Node Name>Element();
element.set<Attribute Name>(<Attribute Value>);
wdContext.node<Node Name>().addElement(element);

You can also check the following link for element creation in Tree UI element:

http://help.sap.com/saphelp_nw70/helpdata/EN/c2/abfceffbacd24185ec7af8a3a2e76a/content.htm