Skip to Content
avatar image
Former Member

Syntax for setAttributeValue ?

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Dec 14, 2005 at 02:59 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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