External XUI event handler code

Useful stuff for users and developers of the XML based dynamic publishing system "Arbortext". All information in this wiki came from posts to the Arbortext Adepters mailing list that were identified by members of that list as being extremely useful because the mailing list has moved around over the years. For more information see the group FAQ.

This forum and its sub-forums are open to the public.
Forum rules
Discussion posts to this group should be relevant to Arbortext users. Posts on other products or from vendors are welcome, so long as the post also mentions or includes Arbortext in the subject matter. General posts on dynamic publishing and posts from vendors other than PTC will be subject to higher scrutiny and should generally avoid posting here (especially if the referenced material does not mention Arbortext). Advertisement posts for other products (e.g., "check out my product as an alternative") are not welcome. This forum is for Arbortext users to communicate with other Arbortext users about working with Arbortext products.

All posts to this forum are moderated.

User avatar
liz
Posts: 266
Joined: Sun May 31, 2015 2:34 am

External XUI event handler code

Postby liz » Mon Jun 15, 2015 5:06 pm

Example by Rob In der Maur of how to place event handler code for a XUI widget outside the XUI document
Last Updated: 2006-07-26


In your code just get hold of the XUI element you want add event handler to, define event handler functionality (what needs to be done when button clicked), set up listener and attach it to the XUI element.

Code: Select all

// get handle to ok button by its id; xuidoc is the document containing the XUI
var okbtn = xuidoc.getElementById("okButton");   

// define what needs to be done when ok button clicked
function handleClickEvent(e) {
  Application.alert("Pressed OK button");
}

// set up event handling
o = { handleEvent: handleClickEvent };

// set up listener with the handler as parameter
var okbtnlistener = Packages.org.w3c.dom.events.EventListener(o);

// attach event listener to ok button
okbtn.addEventListener("DOMActivate", okbtnlistener, false);

Return to “Arbortext Code Archive (adepters.org) (Public)”

Who is online

Users browsing this forum: No registered users and 22 guests