3.0 beta 2

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
March 5,
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)
March 6,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.