cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to pick the data from the input structure

Former Member
0 Kudos

Hi

I have to create a callable object, which has a structure as input parameter. The data in this structure is to be dispalyed in the web dynpro table. The structure can have multiple rows. I wrote the following code in the execute().



this.executionContext = executionContext;

String firstname = null;

String lastname = null;

String username = null;



IWDTextAccessor textAccessor = wdComponentAPI.getTextAccessor();


IStructure input = executionContext.getInputStructure();

try

{ 
Collection users = input.getStructures("User");

Object[] data = users.toArray();

int size = users.size(); 

wdContext.nodeContNode_UserRights().bind(users);

}

catch(Exception ex)

{
ex.printStackTrace();

}

But this code doesn't work. It doesn't initialize the executeContext. i.e.

this.executionContext = executionContext;

line doesnt work. still the value in executionContext is shown as null.

Can anyone please help as to how to go about this problem, and also that how to access the structure data, which i'll be putting in the context node to display it in the table.

Thanks & regards,

Srikant

Accepted Solutions (1)

Accepted Solutions (1)

former_member4529
Active Contributor
0 Kudos

Hi Srikant,

You can use the following code. This works for me.

Remember to set the multiplicity of the User structure to 0...N or 1...N

IGPStructure inputStructure = m_context.getInputStructure();

Collection inputItems = inputStructure.getStructures("User");

if(inputItems == null){

return;

}

for (Iterator iter = inputItems.iterator(); iter.hasNext();) {

//get input item structure and fill context

IGPStructure item = (IGPStructure) iter.next();

String attrName=

item.getAttributeAsString("AttrName");

Thanks & Regards,

Dipankar

Answers (0)