Dynamic object instantiation

I am trying to create a control instantiation, and the method that works in Desktop does not in Web.

I have taken the first example at http://documentation.xojo.com/index.php/New in the LR and tried to adapt it to Web.

Sub Action(index as Integer) Dim pb As WebButton pb=New button1 pb.caption="Clone" pb.Left=Me.Left+Me.Width+10 End Sub

Nothing happens. What am I missing ?
TIA

Use Addbutton1 instead of “New button1”.

Great. Thank you.