on 08-14-2007 3:23 PM
Hello,
i'm trying to copy some selected Elements from a Model Node to a Value Node.
Can i perform somethong like:
wdContext.ValueNode.addElement(wdContext.ModelNode.currentElement);
It schould perfom something like a user assignment. One table at the Portal schows all available users another tabel schould contain all assigned user. A Button schould assign them. So I need to copy the users from one table to another.
I'm happy about every helpul hint.
Greets Norman
Message was edited by:
Norman Trapp
Norman, lets say we have 2 model nodes ModelNode1 and ModelNode2 bound to the same model class (ModelClass). You can use code:
IWDNode node1 = wdContext.nodeModelNode1();
IWDNode node2 = wdContext.nodeModelNode2();
final int size = node1.size();
final int leadSelection = node.getLeadSelection();
Collection selectedNodes = new ArrayList(size);
for (int i = 0; i< size; i++)
{
final IWDNodeElement element = node1.getElementAt( i );
if( leadSelection == i || node1.isMultiSelected( i) )
selectedNodes.add(element.model());
}
node2.bind(selectedNodes);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to create and add new elements in the target node. For copying the attribute values, the utility methods in class WDCopyService are useful.
Something like:
IWDNode source = ...;
I<Target>Node target = ...;
for (int i = 0; i < source.size(); ++i)
{
if ( source.getLeadSelection() == i || source.isMultiSelected(i) )
{
IWDNodeElement src = source.getElementAt(i);
IWDNodeElement tgt = target.create<Target>Element();
target.addElement(tgt);
WDCopyService.copyCorresponding(src, tgt);
}
}
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Armin,
i'll try to explain. I created a ModelNode based on a R/3 FM. I get an export Table from the FM. These table is bound to a UI Element (table) withe create binding.
I need the tabel or parts of the table as import Parameters for another FM.
Actually i'll try to store the needed parts in a ValueNode i created, with structure binding to the ModelNode structure. IMHO these structures must be the same.
Or ist wrong?
My ModelNode Structure looks like a common ModelStructure with an export tabel
My VlaueNode Structure looks like the ModelStructure export tabel.
I hope you have enough info's to see whats going wrong there.
Thanks
Norman
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.