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: Getting the Current Filter
Topic Summary: Getting the Current Filter
Created On: 11-Dec-2007 16:40
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.
Answer This question was answered by David Pechacek, on Tuesday, December 11, 2007 7:51 PM

Answer:
Ah ok I see. In that case just do an if(filtering(current Module)) check before getting the filter.
 11-Dec-2007 16:40
User is offline View Users Profile Print this message


Octavian Stanescu

Posts: 39
Joined: 28-Feb-2005

Hi,
Is there a reliable way of getting the current filter from the current module.

If I have a view that saves a filter, but then take the filter out from the menu bar (funnel icon), the following code does not work.

Module m = current Module
Filter f = current Filter
if(!null f) {
print stringOf(m, f)
}
else {
print "No Filter"
}

It still returns the saved filter from the view.
My Doors is version 7.1 build 71173.
Report this to a Moderator Report this to a Moderator
 11-Dec-2007 17:40
User is offline View Users Profile Print this message


Octavian Stanescu

Posts: 39
Joined: 28-Feb-2005

For now I have the following function which works by returning some error messages when there is a discrepancy detected:

string getCurrentFilter() {
bool isFilterOn = false
Object o
for o in entire currentModule do {
if(table o or row o) continue
if(!isVisible o) {
isFilterOn = true
break
}
}
Filter currentFilter = current Filter
if(null currentFilter) {
if(isFilterOn) {
return "Your View returns no filter but there are filtered objects"
}
else {
return "No Filter"
}
}
else {
if(!isFilterOn) {
return "Your View returns that you have a filter but there are no filtered objects"
}
else {
return stringOf(currentModule, currentFilter)
}
}
}
Report this to a Moderator Report this to a Moderator
 11-Dec-2007 17:56
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

This bit of code works fine for me regardless of whether the filter is applied or not. I rewrote the entire filtering window.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com

Edited: 11-Dec-2007 at 17:57 by David Pechacek
Report this to a Moderator Report this to a Moderator
 11-Dec-2007 18:46
User is offline View Users Profile Print this message


Octavian Stanescu

Posts: 39
Joined: 28-Feb-2005

Yes, but I want to know the filter string only when it is applied, otherwise "No Filter".
Report this to a Moderator Report this to a Moderator
 11-Dec-2007 19:01
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Answer Answer
Ah ok I see. In that case just do an if(filtering(current Module)) check before getting the filter.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 11-Dec-2007 19:52
User is offline View Users Profile Print this message


Octavian Stanescu

Posts: 39
Joined: 28-Feb-2005

YES...
That is exactly what I wanted...
Thank you!
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 2 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 2 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.