![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
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 |
![]() |
![]()
|
![]() |
|
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 ---------------------------------------- |
|
![]() |
|
![]() |
|
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/ |
|
![]() |
|
![]() |
|
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 ---------------------------------------- |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Button Callbacks
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.