on 12-18-2006 7:48 AM
Hello,
I've a scenario where in I need to pass a set of values entered by the user on a WD table. i.e effectively as a structure containing a collection of data. I tried using the following code but without any success.
In the action handler I've the followng code:
IGPStructure output = executionContext.getOutputStructure();
IGPStructure struct = output.addStructure("OUTPUT") ;
for(int i=0; i<wdContext.nodeTable().size() ; i++)
{
ITableElement element = wdContext.nodeTable().getTableElementAt(i);
struct.setAttributeValue("param1", element.getP1());
struct.setAttributeValue("param2", element.getP2());
struct.setAttributeValue("param3", element.getP3());
}
Through this code I got only the last record in the structure. I cannot use setAttributeValues(String,collection) as the attributes' cardinality should be 0:1.
Any leads in this regard will be highly appreciated.
Thanks,
Bala
This is because your structure 'OUTPUT' is set to a cardinality of 1:1. Try inserting:
struct.setMultiplicity(IGPStructureInfo.MULITIPLICITY_0_N);
after
IGPStructure struct = output.addStructure("OUTPUT");
which will set it to 0:N.
~Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It was indeed a problem in the Datatype of the attributes at the recieving end. I'd already set the cardinality to 0:N, but didn't mention that in the thread. Any ways, maintaining a uniform datatype solved the problem.
Bala
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.