Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Trigger by clicking a specific object
Topic Summary:
Created On: 30-Mar-2005 17:58
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 30-Mar-2005 17:58
User is offline View Users Profile Print this message


Thanh Lam

Posts: 17
Joined: 3-Feb-2005

I need dxl code to trigger attached code when an user clicks on a specific object.
For example, when an clicks on column E in a current open module, a GUI will pop up.


Thanks in advance for you help!
Thanh

inputDialog.dxl
inputDialog.dxl  (1 KB)

Report this to a Moderator Report this to a Moderator
 31-Mar-2005 16:57
User is offline View Users Profile Print this message


Dennis Lockshine

Posts: 113
Joined: 7-Apr-2003

According to the DXL Reference Manual, triggers must be applied to a project, module, object, or attribute. To accomplish what you ask, you need to create an attribute trigger. Unfortunately, attributes can only be triggered off the "save" event (pre or post) which means your user must be able to write to the attribute to fire the trigger.

Follow these steps and use the attached code. It should give you a good starting point.

    1. Open any module exclusive edit
    2. Create a new type (I called mine "Trigger"), of type Enumeration with only one possible value -- "List TC Name"
    3. Create an Object attribute (I called mine "List TC Name") and assign it to the type you created, no default value. The other options don't matter because if you do this right, the attribute can never change value. Insert the new attribute into the current view.
    4. Run the attached code in the same module to create the trigger. Make sure the constant ATTRIB_NAME is set to the same name you used in step 3.
    5. Select any object and double-click it's "List TC Name" attribute, select the enumeration value "List TC Name", and a window will pop-up. No matter if you click Run or Cancel, when the window closes, the trigger will cause the attribute value to not be set.

Some notes:

This code was developed and tested using DOORS 7.1, patch 008.

The DXL script that shows the dialog box concludes with the line "set trigPreConFail", which forces the attribute value to be un-set, inserting no history into the module.

I used "block" to raise the dialog because it accomplishes to things. (1) it is modal and forces the user to finish the event, and (2) when you use "show", the dialog box hides behind the module that's currently open.

Again, the attribute must be writable to get the trigger to fire. If the module is open read-only, or if the user does not have access to modify the attribute, the trigger can not be fired.

Good luck!

Edited: 31-Mar-2005 at 17:01 by Dennis Lockshine
Report this to a Moderator Report this to a Moderator
 1-Apr-2005 21:43
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

An Object-sync trigger will fire when you change the current object in the module. You cannot, as far as I can tell, determine which column the user clicked in.

An attribute trigger will fire only when you save a change, which would be after the user modifies a column and clicks somewhere else. function attrDef(Trigger) returns the name of the attribute being saved (incorrectly documented in the manual).

- Louie
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.