cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Insert Tag Callback Events and Object Handles

unknown1
1-Newbie

Insert Tag Callback Events and Object Handles

Hello,

I am successfully capturing insert_tag events using the appropriate callback, but do not know how to accomplish what I want done. I want to be able to insert an id attribute value upon insertion of certain tags. I know how to see what tag the user is inserting, but I do not know how to obtain a handle to a correspondiong DOM object which will allow me to set an attribute value and then have the open document reflect this.

-Anthony
3 REPLIES 3

I'm more familiar with the ACL side but will speculate AOM
follows suit...the insert tag callback fires before the tag is
inserted, allowing you to say yea or nay. I think you want the insert tag
after callback. Its signature should include a reference to the node
that was inserted.





From: Anthony J. Bufort

Sent: Monday, March 27, 2006
5:15 PM
To: Adepters@maillist.arbortext.com
Subject: Insert
Tag Callback Events and Object Handles


Hello,

I am successfully capturing insert_tag events using
the appropriate callback, but do not know how to accomplish what I want done. I
want to be able to insert an id attribute value upon insertion of certain tags.
I know how to see what tag the user is inserting, but I do not know how to
obtain a handle to a correspondiong DOM object which will allow me to set an
attribute value and then have the open document reflect this.

-Anthony

That's just it - I have tried insert_tag_after too, and I get the doc, the tagname, and the op. I don't want the doc, because that means I have to search, and I don't want to do that, especially against an element which has no name or id upon insertion. I just want the Node that was inserted, or which is about to be inserted, I'll take either.

-Anthony

class=133232615-28032006>


Can you depend on the caret telling you which node was
inserted?


function InsertTagAfterCallback( doc, tagname, op
)

{

face=Arial color=#0000ff size=2>if ( op == 2 )

face=Arial color=#0000ff size=2>{

class=133232615-28032006> face=Arial color=#0000ff size=2>local o = oid_current_tag( doc
);

class=133232615-28032006> face=Arial color=#0000ff size=2>if ( oid_name( o ) != tagname
)

class=133232615-28032006> face=Arial color=#0000ff size=2>{

class=133232615-28032006>
# assumption false.


}

face=Arial color=#0000ff size=2>}

}


Looking at href="http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-eventgroupings-mu...,
it looks like you would want the MutationEvent where typeArg is DOMNodeInserted
or DOMNodeInsertedIntoDocument. Comparing this to the AOM, I only see the
DOMAttrModified and DOMCharDataModified events. Hard to believe AOM can't tell
you when an element is inserted or removed. Moving on for now but am interested
if someone has figured this out.









From: Anthony J. Bufort

Sent: Monday, March 27, 2006
5:57 PM
To: Adepters@maillist.arbortext.com
Subject: Re:
Insert Tag Callback Events and Object Handles


That's just it - I have tried insert_tag_after too, and I get the
doc, the tagname, and the op. I don't want the doc, because that means I have to
search, and I don't want to do that, especially against an element which has no
name or id upon insertion. I just want the Node that was inserted, or which is
about to be inserted, I'll take either.

-Anthony >> To unsubscribe
from the list, send an email to listmanager@maillist.arbortext.com with the
following in the body: unsubscribe adepters - For additional information on the
adepters list (how to subscribe or unsubscribe etc), send an email to:
listmanager@maillist.arbortext.com with the following in the body: info Adepters
- You may also go to forums.arbortext.com, enter the Adepters folder and change
your subscription options and preferences.>>
Announcements