cancel
Showing results for 
Search instead for 
Did you mean: 

Syntax for setAttributeValue ?

Former Member
0 Kudos

Hi,

I need to set the attribute value with an integer in the following code. As it expects an Object, I am not sure how to accomplish it.

wdContext.getChildNode("XYZ_Node",wdContext.getLeadSelection()).getElementAt(0).setAttributeValue("XYZ_Attribute",??????);

Any ideas?

Regards

MK

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

MK,

Depends on type of XYZ_Attribute.

Either primitive wrapper (Short, Long, Integer...) or String, or java.sql.Date, or java.sql.Time etc.

VS

Former Member
0 Kudos

I need to give an attribute of type int.

Former Member
0 Kudos

MK,

try this:


final IWDNode node = wdContext.getChildNode("XYZ_Node",wdContext.getLeadSelection());
final IWDNodeElement el = node.getElementAt(0);

el.setAttributeValue("XYZ_Attribute", new Integer(10));

VS

Answers (0)