on 08-13-2007 11:03 AM
Hi all
How do you bind an Attribute to a simple type dynamically?
Regards,
Surya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Surya,
Your question not so clear, however,
if you wanna get simple type for an attribute and set some value set for the same, this will do:
ISimpleTypeModifiable simpleType = wdThis.wdGetContext().getNodeInfo().getChild("TestNode").getAttribute("TestAttr").getModifiableSimpleType();
simpleType.getSVServices().getModifiableSimpleValueSet().put("key", "value");
Regards,
TFG - Aparna .P
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Surya,
I don't know if this is what you want...
To create a atributte in the root node you can use:
wdContext.getNodeInfo().addAttribute("MyAtt", "com.sap.dictionary.string");
To create atributte in the root node from another node (mapped):
wdContext.getNodeInfo().addMappedAttribute("MyNewAttributte","AtributeMapped");
I've never modified the mapping of a node or attributte dynamically... i think that can't be done.
Hope this can be helpful
Eneko
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
Binding ordinary attribute,
IWDNodeInfo NodeInfo = wdContext.getNodeInfo().addMappedChild("NewNode",null,true,true,false,null,false,true);
IWDNodeInfo nodeInfo = wdThis.XXController().wdGetContext().getNodeInfo().getChild("DynamicNode");
NodeInfo.setMapping(nodeInfo ,true);
Simple type attribute :
You can use this code to fill enumeration at runtime.
But this is for Composite Applicaitons, add the required jars and try
TypedFieldDescriptorFactory factory = new TypedFieldDescriptorFactory();
TypedFieldDescriptor descriptor = factory.getTypedFieldDescriptor("", "String", "com.sap.Cities", null, Locale.GERMAN);
ISimpleType type = descriptor.getSimpleType();
ISimpleTypeModifiable modifiable = wdThis.wdGetAPI().getContext().getModifiableTypeOf("Cities.Cities");
modifiable.setSVServices(type.getSVServices());
Check the below thread also,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.