Object Creation On The Fly 
Author Message
 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  
 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  
 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  
 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  
 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  
 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  
 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  
 
 [ 7 post ] 

 Relevant Pages 

1. On the fly object creation question

2. control creation on the fly

3. On-the-Fly password creation

4. control creation on the fly

5. On-the-fly forms creation by program code??

6. Dynamic Forms Creation on the Fly

7. Creation on the fly?

8. Image objects: creating on the fly?

9. New Object on the fly from type

10. Change a control object type on the fly???

11. Creating a custom control object on the fly...

12. Creating Objects on the Fly VB 4.0

 

 
Powered by phpBB® Forum Software