:: Forum >>

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
Wednesday, April 21, 2010
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
Thursday, April 22, 2010
http://www.activewidgets.com/javascript.forum.17509.1/suggestion-for-feature-control-type.html
Thursday, April 22, 2010
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)
Thursday, April 22, 2010
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
Thursday, April 22, 2010

This topic is archived.


Back to support forum

Forum search