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: How to get selected module in database or project window
Topic Summary:
Created On: 6-Apr-2004 08:29
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-Apr-2004 08:29
User is offline View Users Profile Print this message


Jaap Mulder

Posts: 7
Joined: 28-Oct-2003

Hi,

I try to make a DXL script that archives / restores a module with some additional information. I would like this script to run from the Database or Project window (the main window from which one can open modules).

Does anyone know how to get the name/id of the selected (not opened) module?

Mark
Report this to a Moderator Report this to a Moderator
 6-Apr-2004 10:08
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

Item getSelectedItem(void) will give you the item that is currently selected in the explorer window.


-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 6-Apr-2004 13:45
User is offline View Users Profile Print this message


Dennis Lockshine

Posts: 113
Joined: 7-Apr-2003

It's nice that Telelogic has this function fully documented in the DOORS DXL Reference Manual.

Do you know if it is possible to also set the currently selected item and refresh the project manager window to bring that item into view? I tried to change the value of the Item and use setSelectedItem(itm) but DOORS does not recognize the function call.

-Dennis

Edited: 6-Apr-2004 at 13:49 by Dennis Lockshine
Report this to a Moderator Report this to a Moderator
 6-Apr-2004 15:19
User is offline View Users Profile Print this message


Louie Landale

Posts: 2070
Joined: 12-Sep-2002

Doesn't look like it to me. refreshDBExplorer didn't work.

- Louie
Report this to a Moderator Report this to a Moderator
 7-Apr-2004 22:25
User is offline View Users Profile Print this message


Douglas Zawacki

Posts: 97
Joined: 14-Aug-2003

Folks,

How do some people get "undocumented" information? How much useful undocumented information is there? Who do I send a check to so I can get on the list?

Anyway, Thank you for sharing Tony. That was very helpful.
Report this to a Moderator Report this to a Moderator
 13-Apr-2004 09:22
User is offline View Users Profile Print this message


Kristian Bøe

Posts: 29
Joined: 16-Jun-2003

getSelectedItem gives you the first module in a selection. I'm missing a getNextSelectedItem for multiple selections! or at least a isSelected, that way you could loop through all of the modules in a Project and check...

Any suggestions?


-------------------------
Kristian Bøe
Extenda AB
Kristian.Boe@extenda.se
Report this to a Moderator Report this to a Moderator
 14-Apr-2004 13:26
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

You can use the following to loop through the selected items in the database explorer list view (right hand pane).

string iName = ""

for iName in dbExpList do
{
print(iName " is selected in list view\n")
}


You can use the following to get the selected item from the database explorer tree view (left hand pane).

iName = get(dbExpTree)
print(iName " is selected in tree view\n")

dbExpList and dbExpTree are DBEs on the dbExplorer DB. I assume these are declared in the top context.
The only place I have seen these used is in lib/dxl/config/baseWindowShow2.inc.




-------------------------
Tony Goodman
http://www.smartdxl.com
Report this to a Moderator Report this to a Moderator
 14-Apr-2004 16:05
User is offline View Users Profile Print this message


Dennis Lockshine

Posts: 113
Joined: 7-Apr-2003

Using Tony's suggestion above regarding DB dbExpTree and DBE dbTreeView, I was able to answer my own question about how to select a given project or folder in the explorer window.

I was unsuccessful trying to set the given path at once, so to get it to work I had to successively select the next level item. See the attached code for an example.

Thanks Tony!
Report this to a Moderator Report this to a Moderator
 4-Oct-2006 18:02
User is offline View Users Profile Print this message


Dave Brassington

Posts: 1
Joined: 21-Sep-2006

I have had limited success in using Dennis' code to set the currently selected item in the  Database View. I want to have a button on a dialogue box that takes the user to a particular folder in a project. Sometimes the code works but most of the tmie it appears to do nothing.
Dennis - have you developed a better technique to achieve this?
Has anyone else got a technique to do this?
Any help would be much appreciated

Thanks

Dave
Report this to a Moderator Report this to a Moderator
 6-Oct-2006 14:14
User is offline View Users Profile Print this message


Dennis Lockshine

Posts: 113
Joined: 7-Apr-2003

Dave,

I have not done any further development of this technique. I have noticed, however, that the database view setting can have an effect on the results (View > Database View vs View > Project View). There are also issues if you have a Project embedded within a Project.

If you are using the fullName(item) perm to get the absolute path, I recommend that you also experiment with using the unpublished rootName_(item) perm and see if you can produce better results. The former will give you the path from the parent project, and the latter will give you the path from the database root, which will be different for sub-projects.

The code I posted over two years (!) ago needs to parse the path to the object and activate each portion of the path in turn, thus there should be a correlation between the database view and the path to the item.

Good luck!

-Dennis
Report this to a Moderator Report this to a Moderator
 12-Mar-2007 16:44
User is offline View Users Profile Print this message


Reik Schroeder

Posts: 361
Joined: 28-Jul-2003

Hi Dennis,

late answer, but it could be the right one

you can set the selected item in database treeview by using following statement:

set (dbExpTree, "databasename/pathtoitem");

The variable dbExpTree is the DBE handle of the treeview in main window and it can be handled like a normal tree view ...

Greetings
Reik

-------------------------
Evosoft GmbH
for Siemens Industry Sector


Berlin, Germany
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 0 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 0 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.