3.0 beta 2

get all items on page

i want to get all aw elements on the page, so i wud loop into them. the page has different aw elements minus grid.
jc
April 21,
anyone ??????????? how do i loop through the page's activewidgets components? currently, i am using document.getelementsbytagname("input") to get an array of all components. problem is, i cannot use some of activewidgets function on this item like getcontrolvalue(), etc. PLS, WAITING....
jc
April 22,
April 22,
If you know the id of an html element then you can call AW.object(id) to obtain the reference to the corresponding AW object. Please note that the <input> tag is not the top level element in AW.UI.Input control, so if your id looks like myInput-box-text or myInput-edit you should go a few levels up.
Alex (ActiveWidgets)
April 22,
thanks. alex. done it a little differently, not sure if it's a right way.

var FormElements = document.getElementsByTagName("input");
        FormElementsLength = FormElements.length;
    for(i=0; i<FormElementsLength; i++)
    {
      ParentClass = eval(FormElements[i].parentNode.parentNode);
      ParentClass = ParentClass.getAttribute("id");
      
      ParentClass = eval(ParentClass);
      ControlValue = ParentClass.getControlValue();
      
      Required = FormElements[i].getAttribute("required");
      if(Required)
      {
        if(ControlValue == null || ControlValue == "-999" || 'undefined' == ControlValue)
        {
          return false;
        }
      }
    }
    return true;
jc
April 22,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.