cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Input Boxes not enabled

former_member540174
Participant
0 Kudos

I have a requirement to create Input boxes on the fly (note in the code posted I have the amount of boxes hardcoded - this will change).

I am getting the input boxes desired, however, the are not enabled - you cannot enter data into them. What step did I miss? Did I forget to add something to context?

Thoughts?


//@@begin wdDoModifyView
if (firstTime)
{
  IWDNodeInfo employees = wdContext.getNodeInfo().addChild("Employees",null,true,false,true,	false,true,false,null,null,null);
  employees.addAttribute("employeeUserId","ddic:com.sap.dictionary.string");
		
  IWDTransparentContainer employeeContainer = (IWDTransparentContainer)view.getElement("EmployeeContainer");
  for(int i=0; i<5; i++)
  {
    IWDInputField emplUserId = (IWDInputField) view.createElement(IWDInputField.class,"emplUserId" + i);
		emplUserId.setLength(8);
		emplUserId.setReadOnly(false);
		emplUserId.setEnabled(true);
    IWDNodeInfo nodeinfo = wdContext.getChildNode("Employees", 0).getNodeInfo();
    emplUserId.bindValue(nodeinfo.getAttribute("employeeUserId"));
    employeeContainer.addChild(emplUserId);
  }

Edited by: Diane Fuller on Feb 28, 2008 1:44 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Simply replace the first line of code with below code.


IWDNodeInfo employees = wdContext.getNodeInfo().addChild("Employees",null,true,true,false,true,false,false,null,null,null);

Regards,

Naga

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Please ignore the previous answer.You have done the binding,but create you did not create the node element.

IEmployeesElement ele= wdContext.nodeEmployees().createEmployeesElement();

wdContext.nodeEmployees().addElement(ele);

Regards,

Sudhir

Edited by: Sudhir Gorantla on Feb 28, 2008 1:55 PM

Former Member
0 Kudos

Hi,

You did not bind the inputboxes to context variables.If you have already binded then set the cardinality to 1:n.

Regards,

Sudhir