:: Forum >>

Create Widget Element not in a body script

Is it possible to create e.g. a AW.Button not in bodyscript?
I don't want to use:

<script>
....
document.write(button);
</script>

Thanx for your help
Claudia
Monday, March 5, 2007
Yes, there are many other ways to insert AW object. Instead of using document.write() you can also put AW object inside any element on the page using innerHTML property -

document.getElementById("parentID").innerHTML = obj;

Another way is to insert empty 'placeholder' tag with the same id as your AW control and then replace it calling refresh() method -

<span id="myButton"></span>
...
<script>
var button = new AW.UI.Button;
button.setId("myButton"); // use the same id as in placeholder tag
...
button.refresh(); // replace placeholder tag
</script>
Alex (ActiveWidgets)
Tuesday, March 6, 2007

This topic is archived.


Back to support forum

Forum search