cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic contexts

Former Member
0 Kudos

hi All,

I have created node and value attribute dynamically in the a view and the controller. but not mapped them, since i m binding dynamically generated Dropdowns to these attributes,mapping the nodes of the view and controller is making the dropdown disabled. so i have not mapped the view node and the controller node.

the code i have used to create these are below.

now i want the values selected from the dropdown in the view to be available in the controller.

how can i do this ?

plz help.

*View:* wddoinit() method

//creates a node called TaskLst in the view

IWDNodeInfo viewnodeInfo = wdThis.wdGetAPI().getContext()

.getRootNodeInfo()

.addChild("TaskLst",null,true,true,false,false,false,true,null,null,null);

//creates 15 value attributes inside node TaskList with name Task + i and value taken form data dictionary.

for(int i = 0;i<15;i++)

viewnodeInfo .addAttribute("Task"+i,"com.xyz.dynamic.taskvalue");

*View:* wddomodify() method

//creating dropdowns dynamically and binding it to dynamically generated attributes

for(int i =0; i<20;i++)

{

IWDAttributeInfo attrInfo = wdThis.wdGetAPI().getContext().getRootNode().getChildNode("TaskLst",IWDNode.LEAD_SELECTION).getNodeInfo().getAttribute("Task"+i);

IWDDropDownByKey downByKey = (IWDDropDownByKey)view.createElement(IWDDropDownByKey.class,"drop"+i);

downByKey.bindSelectedKey(attrInfo);

matData = (IWDMatrixData)downByKey.createLayoutData(IWDMatrixData.class);

Controller :

//creates a node called TaskList in the controller

IWDNodeInfo CustnodeInfo = wdThis.wdGetAPI().getContext()

.getRootNodeInfo()

.addChild("TaskList",null,true,true,false,false,false,true,null,null,null);

//creates 15 value attributes inside node TaskList with name Task + i and value taken form data dictionary.

for(int i = 0;i<15;i++)

CustnodeInfo .addAttribute("Task"+i,"com.xyz.dynamic.taskvalue");

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

answered

Former Member
0 Kudos

Please refer [dynamic context mapping|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6fdae690-0201-0010-a580-d104b459cb44] to achieve what you are looking for.

Former Member
0 Kudos

Hi Bala,

since i m using dropdowns, which is not available in the link you gave. they have used mapped dynamic node between the view and the controller.

but i dont have to the map the nodes. plz once again read my query.

thanks

Former Member
0 Kudos
since i m binding dynamically generated Dropdowns to these attributes,mapping the nodes of the 
view and controller is making the dropdown disabled.

What do you mean by this.. AFAIK, binding the mapped node is not the reason for this. If the drop downs

are disabled, it is because the node that is bound doesn't contain any elements. So, create an element to

the node that is bound to the drop down..It should work..

Former Member
0 Kudos

Hi Bala,

can i get your email id.

Thanks

Former Member
0 Kudos

Hi,

As your for loops looks fixed, Why not static context from controller mapped to view and UI elements.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Ayyapparaj KV,

that is just for testing, the loop will run depending upon an output coming form the rfc.

Edited by: akhilesh singh on Nov 8, 2008 12:03 PM