on 04-06-2006 6:44 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.