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: Refresh dialog box elements
Topic Summary: Update label and list
Created On: 12-Dec-2006 17:35
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 Thursday, December 21, 2006 8:28 PM

Answer:
Figured it out for what I'm doing:

 12-Dec-2006 17:35
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

I'm trying to create a dialog box that tells a user how many columns are in the current view and how many they can add (to the max of 32 columns in a view).  The script also adds columns so if theres 31 columns and they want to add 2, they need to remove one which it lets them do. 

The part I'm not sure on is if they select a column and I delete it, how do I refresh the dialog box to reflect the new number of columns in the view and refresh the list of columns so that the column they removed is no longer there.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 12-Dec-2006 20:54
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

Answer Answer
Figured it out for what I'm doing:



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

Edited: 21-Dec-2006 at 14:09 by David Pechacek
Report this to a Moderator Report this to a Moderator
 20-Dec-2006 20:10
User is offline View Users Profile Print this message


Krishna Kandala

Posts: 170
Joined: 8-Jul-2006

Hi David,

I am working on  a similar code, but the list DBE consists an array of strings, not integers. The 'delete' function is not working with a string arg - the selected string is not getting deleted from the list. How do I go about it? Is there any way to 'refresh' the contents of the listDBE which displays the values of a string array? Any suggestions will be appreciated.
Report this to a Moderator Report this to a Moderator
 21-Dec-2006 14:03
User is offline View Users Profile Print this message


David Pechacek

Posts: 674
Joined: 5-Dec-2006

My list was also a list of strings.  The column headings for every column in the current view to be exact.  What (part of) my program did was let a user select a column from the current view and delete it.  The code I posted took that selection, deleted the column, removed it from the list, and updated the window the module was in. 

The "int selectedColumn" variable is the selection of what column the user chose.  So if you have 5 columns in the list and the user selects the 3rd one in the list (index 2 in the array since arrays start at 0), selectedColumn will be 2.  Remember that the get() function regardless of the data in the array can return an integer OR a string(plus many other types).  If you assign the result of get() to a string variable, the returned result will be the string of the selected item in the list.  If you use it on an int variable, you get the position in the list(and also the array) of the selected item in the list.

So, once you get which item in the list you want to delete, you use that
for(selectedIndex; selectedIndex < maxIndex; selectedIndex++) loop to go through the list starting at the selected item and move each item below it in the list up one index(using the insert() command).  The "else" condition moves each element in the array/list up one index.  The main "if" condition is for the last item in the array/list that has already been copied to the previous index.  You set it equal to "" in the array and then delete that item from the list. 

So basically you just need to change your variable that you're using to get the selected item in your list that you want to delete from a string to an integer. 

For a list of all the different types the get() function can return from a DBE look in the DXL Reference manual under Dialog boxes -> Common element operations -> get(element or option).

Finally, I'm not sure but you might just be able to call delete() on the selected item in the list without reordering the list like I did in my loop using insert().  But I chose to keep my array and list indexes the same. If you don't care about the indexes being the same, just try deleting it from the list.

-------------------------
David Pechacek
AAI Services Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Report this to a Moderator Report this to a Moderator
 21-Dec-2006 18:12
User is offline View Users Profile Print this message


Krishna Kandala

Posts: 170
Joined: 8-Jul-2006

Thanks for the detailed explanations. The identification of the selected item in the list is a great help in  the deletion of the item from the list. I worked on my code on the same lines and it works very well.
Thanks again
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.