Object Creation On The Fly
Author |
Message |
Jim Sorni #1 / 7
|
 Object Creation On The Fly
Hello again, I have an ocx that I have created, and would like to populate a web page with it based on some input from the user. If the user says that he/she has 3 stations, I would like to populate the screen with three of these objects. Can I do this ? I have tried the following code, but I am at a Standstill trying to get this to display on the Page. Sub CreateObj() Dim newOBJ Set newOBJ = CreateObject("myOcx.myObject") newObj.Caption = "Test" End Sub I don't get any errors with the above code, and I can get to the properties of myObject. Like: newOBJ.Caption = "Test" The code does not error. The problem is that the object doesn't show up on the Web Page. Thanks for helping Jim
|
Tue, 07 Sep 2004 02:45:46 GMT |
|
 |
Michael Harri #2 / 7
|
 Object Creation On The Fly
Use document.createElement("object") then assign the appropriate id, classid, etc. properties then use document.body.appendChild to append it to the document body (or call appendChild on a div or some other element). -- Michael Harris Microsoft.MVP.Scripting Seattle WA US -- Quote:
> Hello again, > I have an ocx that I have created, and would like to populate a web page > with it based on some input from the user. If the user says that he/she has > 3 stations, I would like to populate the screen with three of these objects. > Can I do this ? > I have tried the following code, but I am at a Standstill trying to get this > to display on the Page. > Sub CreateObj() > Dim newOBJ > Set newOBJ = CreateObject("myOcx.myObject") > newObj.Caption = "Test" > End Sub > I don't get any errors with the above code, and I can get to the properties > of myObject. > Like: > newOBJ.Caption = "Test" > The code does not error. The problem is that the object doesn't show up on > the Web Page. > Thanks for helping > Jim
|
Tue, 07 Sep 2004 04:03:52 GMT |
|
 |
Jim Sorni #3 / 7
|
 Object Creation On The Fly
Michael, Thanks for replying, Are you saying that I should do something like the following ??? Sub CreateOBJ() Set newOBJ = document.createElement("myObject") newOBJ.ID = "Whatever" newOBJ.Clsid = "Real Class ID" document.body.appendchild newOBJ End Sub Thanks for helping Jim
Use document.createElement("object") then assign the appropriate id, classid, etc. properties then use document.body.appendChild to append it to the document body (or call appendChild on a div or some other element). -- Michael Harris Microsoft.MVP.Scripting Seattle WA US --
Quote: > Hello again, > I have an ocx that I have created, and would like to populate a web page > with it based on some input from the user. If the user says that he/she has > 3 stations, I would like to populate the screen with three of these objects. > Can I do this ? > I have tried the following code, but I am at a Standstill trying to get this > to display on the Page. > Sub CreateObj() > Dim newOBJ > Set newOBJ = CreateObject("myOcx.myObject") > newObj.Caption = "Test" > End Sub > I don't get any errors with the above code, and I can get to the properties > of myObject. > Like: > newOBJ.Caption = "Test" > The code does not error. The problem is that the object doesn't show up on > the Web Page. > Thanks for helping > Jim
|
Tue, 07 Sep 2004 05:05:09 GMT |
|
 |
Jim Sorni #4 / 7
|
 Object Creation On The Fly
Ok, I should try a little harder before reposting Heres what I did. Thank you for your post Set myObj = document.createElement("object") myObj.ID = "GIVEMEANAME" myObj.classid="clsid:B230030A-15E8-4F71-84E8-ACE9C93A304E" document.body.appendchild myOBJ Thanks for all the help. Jim
Quote: > Michael, > Thanks for replying, > Are you saying that I should do something like the following ??? > Sub CreateOBJ() > Set newOBJ = document.createElement("myObject") > newOBJ.ID = "Whatever" > newOBJ.Clsid = "Real Class ID" > document.body.appendchild newOBJ > End Sub > Thanks for helping > Jim
> Use document.createElement("object") then assign the appropriate id, > classid, etc. properties then use document.body.appendChild to append it to > the document body (or call appendChild on a div or some other element). > -- > Michael Harris > Microsoft.MVP.Scripting > Seattle WA US > --
> > Hello again, > > I have an ocx that I have created, and would like to populate a web page > > with it based on some input from the user. If the user says that he/she > has > > 3 stations, I would like to populate the screen with three of these > objects. > > Can I do this ? > > I have tried the following code, but I am at a Standstill trying to get > this > > to display on the Page. > > Sub CreateObj() > > Dim newOBJ > > Set newOBJ = CreateObject("myOcx.myObject") > > newObj.Caption = "Test" > > End Sub > > I don't get any errors with the above code, and I can get to the > properties > > of myObject. > > Like: > > newOBJ.Caption = "Test" > > The code does not error. The problem is that the object doesn't show up on > > the Web Page. > > Thanks for helping > > Jim
|
Tue, 07 Sep 2004 05:22:52 GMT |
|
 |
Jim #5 / 7
|
 Object Creation On The Fly
Ok, So now I have the object loaded on the page, but I cann't access the click events built into the object. Any Suggestions ? Thanks Jim
Quote: > Ok, I should try a little harder before reposting > Heres what I did. Thank you for your post > Set myObj = document.createElement("object") > myObj.ID = "GIVEMEANAME" > myObj.classid="clsid:B230030A-15E8-4F71-84E8-ACE9C93A304E" > document.body.appendchild myOBJ > Thanks for all the help. > Jim
> > Michael, > > Thanks for replying, > > Are you saying that I should do something like the following ??? > > Sub CreateOBJ() > > Set newOBJ = document.createElement("myObject") > > newOBJ.ID = "Whatever" > > newOBJ.Clsid = "Real Class ID" > > document.body.appendchild newOBJ > > End Sub > > Thanks for helping > > Jim
> > Use document.createElement("object") then assign the appropriate id, > > classid, etc. properties then use document.body.appendChild to append it > to > > the document body (or call appendChild on a div or some other element). > > -- > > Michael Harris > > Microsoft.MVP.Scripting > > Seattle WA US > > --
> > > Hello again, > > > I have an ocx that I have created, and would like to populate a web page > > > with it based on some input from the user. If the user says that he/she > > has > > > 3 stations, I would like to populate the screen with three of these > > objects. > > > Can I do this ? > > > I have tried the following code, but I am at a Standstill trying to get > > this > > > to display on the Page. > > > Sub CreateObj() > > > Dim newOBJ > > > Set newOBJ = CreateObject("myOcx.myObject") > > > newObj.Caption = "Test" > > > End Sub > > > I don't get any errors with the above code, and I can get to the > > properties > > > of myObject. > > > Like: > > > newOBJ.Caption = "Test" > > > The code does not error. The problem is that the object doesn't show up > on > > > the Web Page. > > > Thanks for helping > > > Jim
|
Tue, 07 Sep 2004 21:55:54 GMT |
|
 |
Jim #6 / 7
|
 Object Creation On The Fly
The Click Events aren't the typical "OnClick". These events are called, for instance, LPMachineClick. This sub is defined with some Params that are returned from the object when clicked. I can assign the OnClick event to a Button if I instantiate it, but this particular object doesn't use the typical OnClick. Thanks for helping Jim
Quote: > Ok, So now I have the object loaded on the page, but I cann't access the > click events built into the object. Any Suggestions ? > Thanks > Jim
> > Ok, I should try a little harder before reposting > > Heres what I did. Thank you for your post > > Set myObj = document.createElement("object") > > myObj.ID = "GIVEMEANAME" > > myObj.classid="clsid:B230030A-15E8-4F71-84E8-ACE9C93A304E" > > document.body.appendchild myOBJ > > Thanks for all the help. > > Jim
> > > Michael, > > > Thanks for replying, > > > Are you saying that I should do something like the following ??? > > > Sub CreateOBJ() > > > Set newOBJ = document.createElement("myObject") > > > newOBJ.ID = "Whatever" > > > newOBJ.Clsid = "Real Class ID" > > > document.body.appendchild newOBJ > > > End Sub > > > Thanks for helping > > > Jim
> > > Use document.createElement("object") then assign the appropriate id, > > > classid, etc. properties then use document.body.appendChild to append it > > to > > > the document body (or call appendChild on a div or some other element). > > > -- > > > Michael Harris > > > Microsoft.MVP.Scripting > > > Seattle WA US > > > --
> > > > Hello again, > > > > I have an ocx that I have created, and would like to populate a web > page > > > > with it based on some input from the user. If the user says that > he/she > > > has > > > > 3 stations, I would like to populate the screen with three of these > > > objects. > > > > Can I do this ? > > > > I have tried the following code, but I am at a Standstill trying to > get > > > this > > > > to display on the Page. > > > > Sub CreateObj() > > > > Dim newOBJ > > > > Set newOBJ = CreateObject("myOcx.myObject") > > > > newObj.Caption = "Test" > > > > End Sub > > > > I don't get any errors with the above code, and I can get to the > > > properties > > > > of myObject. > > > > Like: > > > > newOBJ.Caption = "Test" > > > > The code does not error. The problem is that the object doesn't show > up > > on > > > > the Web Page. > > > > Thanks for helping > > > > Jim
|
Wed, 08 Sep 2004 02:50:51 GMT |
|
 |
Michael Harri #7 / 7
|
 Object Creation On The Fly
Search the scripting NGs at groups.google.com for all the words: createelement script htmlfor event for examples of dynamically creating script elements to handle the events of dynamically created object elements... -- Michael Harris Microsoft.MVP.Scripting Seattle WA US -- Quote:
> Ok, So now I have the object loaded on the page, but I cann't access the > click events built into the object. Any Suggestions ? > Thanks > Jim
> > Ok, I should try a little harder before reposting > > Heres what I did. Thank you for your post > > Set myObj = document.createElement("object") > > myObj.ID = "GIVEMEANAME" > > myObj.classid="clsid:B230030A-15E8-4F71-84E8-ACE9C93A304E" > > document.body.appendchild myOBJ > > Thanks for all the help. > > Jim
> > > Michael, > > > Thanks for replying, > > > Are you saying that I should do something like the following ??? > > > Sub CreateOBJ() > > > Set newOBJ = document.createElement("myObject") > > > newOBJ.ID = "Whatever" > > > newOBJ.Clsid = "Real Class ID" > > > document.body.appendchild newOBJ > > > End Sub > > > Thanks for helping > > > Jim
> > > Use document.createElement("object") then assign the appropriate id, > > > classid, etc. properties then use document.body.appendChild to append it > > to > > > the document body (or call appendChild on a div or some other element). > > > -- > > > Michael Harris > > > Microsoft.MVP.Scripting > > > Seattle WA US > > > --
> > > > Hello again, > > > > I have an ocx that I have created, and would like to populate a web > page > > > > with it based on some input from the user. If the user says that > he/she > > > has > > > > 3 stations, I would like to populate the screen with three of these > > > objects. > > > > Can I do this ? > > > > I have tried the following code, but I am at a Standstill trying to > get > > > this > > > > to display on the Page. > > > > Sub CreateObj() > > > > Dim newOBJ > > > > Set newOBJ = CreateObject("myOcx.myObject") > > > > newObj.Caption = "Test" > > > > End Sub > > > > I don't get any errors with the above code, and I can get to the > > > properties > > > > of myObject. > > > > Like: > > > > newOBJ.Caption = "Test" > > > > The code does not error. The problem is that the object doesn't show > up > > on > > > > the Web Page. > > > > Thanks for helping > > > > Jim
|
Wed, 08 Sep 2004 03:41:17 GMT |
|
|
|