:: Forum >>

Multiple AW space.

Is this possible?

Say I have a few sets of identical controls on the same page. Currently, I prefix each control ids with the set names. It would be much easier to manage if each set can be treated as seperate instance of the same class with their own unique name.
Wai
Wednesday, February 6, 2008
Sorry, I don't really understand what you mean - could you please explain in more details?
Alex (ActiveWidgets)
Thursday, February 7, 2008
This is what I am talking about. I solved by encap in a class, and it works perfectly.

function myClass()
{
var myInput;
var myButton;

myInput = new AW.UI.Input;
myInput.setControlText("Input");
document.write(myInput);
myButton = new AW.UI.Button;
myButton.setControlText("Click Here");

myButton.onControlClicked=function(evt)
{
alert(myInput.getControlValue());
}
document.write(myButton);
}

var firstInstance = new myClass();
var secondInstance = new myClass();

The buttons are tied to their respective instance of the same class.
Wai
Monday, February 11, 2008

This topic is archived.


Back to support forum

Forum search