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: Button Callbacks
Topic Summary: Callbcks and current object
Created On: 6-Nov-2008 10:30
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.
 6-Nov-2008 10:30
User is offline View Users Profile Print this message


Mark Williamson

Posts: 79
Joined: 12-Sep-2005

Hi All,

I have successfully implemented callbacks for list views etc but am wrestling with a button call back.

Essentially I have a DB containing a DBE text and this is set with the object text from the current module. I have create three buttons for Accept, Reject and Add and need to do simple navigation like delete the current object and go to next object or simply go to next object if accepted.

I currently have print statements in the call backs and these work proving that the call back is actually being called, but any object function I create fails as the current object is not identified. Is it necessary to pass the current object in the callback. I fail to see why this would be so.



Any pointers would be much appreciated

Thanks

Mark

-------------------------

mark_williamson@synthesys.co.uk
http://www.synthesys.co.uk
----------------------------------------
Report this to a Moderator Report this to a Moderator
 6-Nov-2008 11:17
User is offline View Users Profile Print this message


Pekka Mäkinen

Posts: 276
Joined: 18-Mar-2004

You have to define a global object variable at the beginning of the script, where you store the current object:

Object currObj = current

Then the callback functions can access this object variable to the get the current object. Note that if you add or delete an object you will have to think how that influences the current object.

BTW, looking at your code example, you allow DOORS to define you variables on the fly. This is described in the DXL Help as

"In DXL there is a mechanism called auto-declare, which means that a user need not specify a type for a variable. For example, in the script:

i=5
print i
the interpreter declares a new variable and deduces from the assignment that its type is int.

Because DXL is case-sensitive, there is a potential hazard when relying on this mechanism to type variables. If you make a mistake when typing a variable name, the interpreter assumes that a new variable is being used, which creates errors that are hard to find.

This feature can be disabled by adding the line:

XFLAGS_ &=~AutoDeclare_
to the bottom of the file $DOORSHOME/lib/dxl/startup.dxl. "

-------------------------
Pekka.Makinen@softqa.fi
SoftQA Oy -http://www.softqa.fi/
Report this to a Moderator Report this to a Moderator
 6-Nov-2008 13:36
User is offline View Users Profile Print this message


Mark Williamson

Posts: 79
Joined: 12-Sep-2005

Hi Pekka,

Thank you for your valued response. I was almost there in that I had declared a global object but I had not referenced it to current Object.

I typically declare all my variables and do not use Auto declare for the reasons you quite correctly state above. My code snippett did not include the declarations above. The learning curve is still steep but now making a little progress.

Many thanks

Mark

-------------------------

mark_williamson@synthesys.co.uk
http://www.synthesys.co.uk
----------------------------------------
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.