on 11-08-2008 10:16 AM
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");
answered
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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..
Hi,
As your for loops looks fixed, Why not static context from controller mapped to view and UI elements.
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.