2 Replies Latest reply on Oct 10, 2012 11:08 PM by ibarbaric

    Dynamically get text field value (getAttribute)

    ibarbaric

      Hi,

      I have a subroutine which should get any element attribute dynamically, based on attribute name. Simplified version would be as:

      function getElementAttribute(iElement, iAttributeName) {
        getElementAttribute = iElement.getAttribute(iAttributeName);
      }
      

      This works good, except that I don't know how to get text field value fully dynamic. Static and semi-dynamic code that works would be:

      getElementAttribute = iElement.value.text.value; //fully static
      getElementAttribute = iElement.resolveNode("#value.#text").value; //semi-dynamic
      

      However, I can't make it in fully dynamic and generic way.

      Here are my unsuccessful attempts:

      iElement.resolveNode("#value.#text").getAttribute("value");
      iElement.resolveNode("#value.#text.#value");
      iElement.getAttribute("rawValue");
      iElement.getAttribute("value.text.value");
      iElement.getAttribute("#value.#text.#value");
      

      Does anyone know solution to this?

      Thanks!

      KR,

      Igor Barbaric