on 08-23-2006 8:43 AM
Hello,
Im trying to fill an UI dynamically. I've created a layout with mostly Inputfields with propert id'sn. Now i try in the wdDoModifyView to create a node with appropriate attributes to fill the inputfields. Im doing:
if(firstTime)
{
//create an APNode under which all the ap specific fields are gonna be created
IWDNodeInfo nodeInfo = wdContext.getNodeInfo().addChild("APNode",null,true,true,false,false,false,true,null,null,null);
//create a attribute invoice under apNode
IWDAttributeInfo info = wdContext.getChildNode("APNode",IWDNode.LEAD_SELECTION).getNodeInfo().addAttribute("invoice","ddic:com.sap.dictionary.string");
//get the field and bind it to the attribute just created
IWDInputField field = (IWDInputField)view.getElement("invoiceInputField");
field.bindValue(info);
//fill the attribute with mock data
IWDNodeElement dynEle = wdContext.getChildNode("APNode",IWDNode.LEAD_SELECTION).createElement();
dynEle.setAttributeValue("invoice", "1234545");
}
But the invoice number isnt shown in my invoiceInputField. There is an inputfield with and id "invoiceInputField" btw.
Can anyone tell me what im doing wrong?
much thanks,
Hugo
Hi,
1)Create the node and attribute in the initmethod
IWDNodeInfo n= wdContext.getNodeInfo().addChild("APNode",null,true,true,true,false,true,true,null,null,null);
n.addAttribute("invoice","ddic:com.sap.String");
//getting child node
IWDNode n1= wdContext.getChildNode("APNode",0);
IWDNodeElement nel=n1.createElement();
String s1=new String("1234545");
nel.setAttributeValue("invoice",s1);
n1.addElement(nel);
2) Create inputField and bind the att.in the modify
//Get the root Container
IWDTransparentContainer trans=(IWDTransparentContainer)view.getElement("RootUIElementContainer");
//create the inputField
IWDInputField ip=(IWDInputField)view.createElement(IWDInputField.class,"input1");
ip.bindValue("APNode.invoice");
trans.addChild(ip);
Hope this helps,
Regards,
Vijayakhanna Raman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Your addchild method adds a child with mandatoryselection = false. Later you retrieve the nodeInfo using lead_selection.
Try setting the mandatoryselection to true or try getChildNode("APNode",0).
Good luck,
Roelof
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.