Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Need help with Context and UI

Hello,

I am getting employees details from a certain repository

Each employee details contain the following info - ID, Name and Address.

I would like to create the following UI for it:

A DropDown by Key which will contain the employees IDs.

Each selection of an ID shows the relevant employee details on Text Views.

In order to acheive this I've created the relevant UI and this Contex:

At the context root I've created a Context Node called AllEmployees and inside it I've created an ID ttribute (called employeeID) Aand a Context Node with cardinality 1...1 by the name Details which contains the Name and Address Attributes.

I bounded each UI to it's relevant Context and initialized it like this:

I

PrivateMainView.IAllEmployeesElement newEmployee;
PrivateMainView.IDetailsElement newDetails;
	 
ISimpleTypeModifiable idType = wdThis.wdGetAPI().getContext().getModifiableTypeOf("AllEmployees.employeeID");

IModifiableSimpleValueSet idValues = idType.getSVServices().getModifiableSimpleValueSet();
	 
while(...)
{
newEmployee = wdContext.createAllEmployeesElement();
newEmployee.setEmployeeID(id);
idValues.put(id,id);
						
wdContext.nodeAllEmployees().addElement(newEmployee);
newDetails = wdContext.createDetailsElement();
newDetails.setName(name);
newDetails.setAddress(address);
newEmployee.nodeDetails().bind(newDetails);
}

The result is that the DropDown contains the IDs but selecting and ID doesn't result in showing the relevant details on the Text Views.

Can anyone please help me with that?

Former Member
Former Member replied

Hi,

Check this out.

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

{

IPrivateTestAppView.IVnEmployeeElement neEmp =wdContext.createVnEmployeeElement();

neEmp.setVaID(""+i);

wdContext.nodeVnEmployee().addElement(neEmp);

IPrivateTestAppView.IVnDetailsElement neDet = wdContext.createVnDetailsElement();

neDet.setVaName("Text"+i);

neEmp.nodeVnDetails().addElement(neDet);

}

Now create a dummy action for DropDownByIndex UI element.

The problem might be u didnot still make the childNode as non-singleton.

This is perfectly working.I checked it out.

Regards,

Sowjanya.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question