DOORS Tables and selection

hello,

I really have no experience with DXL/DOORS tables but is there a way of selecting a range of rows within a table to peform a modification on a certain column(s)? I would like to select a range(gui) then change a columns value to ?? is there a way?

Thank you,
Jim
 

DB db
DBE currentRevision
DBE currentRevisionDate
DBE currentRemarks 
 
void update(DB win)
{
    if(cell(current Object))
        {
                Skip currentRow = create ()
                int column = -1
 
                Object tableCell
                Object rowObject = getRow(current Object)
 
                for tableCell in rowObject do
                {
                        put(currentRow, ++column, tableCell)
                }
 
                Object currObj1, currObj2
                if(find(currentRow, 2, currObj1))
                        if(find(currentRow, 4, currObj2))
                        {     
                                currObj1."Object Text" = richText (richTextWithOle currObj2."Object Text")
                                currObj2."Object Text" = get(currentRevision)
                        }
                                
                if(find(currentRow, 3, currObj1))
                        if(find(currentRow, 5, currObj2))
                        {
                                currObj1."Object Text" = richText (richTextWithOle currObj2."Object Text")
                                currObj2."Object Text" = get(currentRevisionDate)
                        }
                        
                if(find(currentRow, 7, currObj1))
                        currObj1."Object Text" = get(currentRemarks)
                        
                delete currentRow
                refresh(current Module)
        }else{ack "Current object is not a cell within a DOORS table!"}
}
 
db = create ("DOORS TABLE(DIL Editor)", styleStandard|styleCentered)
 
currentRevision = field(db,"Current Revision:", "", 20, false)
below
currentRevisionDate = field(db,"Date:", "", 20, false)
below
currentRemarks = field(db,"Remarks:", "", 20, false)
 
apply(db,"Ok",update)
show db

SystemAdmin - Tue Apr 17 14:40:42 EDT 2012

Re: DOORS Tables and selection
llandale - Tue Apr 17 17:35:55 EDT 2012

Nice clean code, easy to read, looks like it would work.

Well, except for the "current" Object and Module part. If you open your gui, then open another module, then push the button, the "current" Object and Module will be the 2nd Module. You need:
  • Module mCurr = current // top of script
  • Object oCurr = curret(mCurr) // inside your callback

As for your question: If you are expecting the user to select some cells in more than one row..
  • void getSelection(mCurr, oFirst, oLast) //looks like it will get the 1st and last selected objects.
  • oNext = next(oNext) // will plow through the selection
  • if (oNext == oLast) then this is the last selected object
  • if (!cell(oNext)) then ignore this row object, which is also selected but you cannot see it.
  • if (oRowDone == row(oNext)) then I've already dealt with this row
  • oRowDone = oRow // when finished with a row

There is also:
  • oTable = table(oCell) // if you need the table header object, and
  • for oRow in oTable do // plow through the rows

But if I read your code correctly, the user will be entering new Text and Revision date, which seems to me to only make sense for a single row.

-Louie

Re: DOORS Tables and selection
SystemAdmin - Tue Apr 17 19:08:59 EDT 2012

llandale - Tue Apr 17 17:35:55 EDT 2012
Nice clean code, easy to read, looks like it would work.

Well, except for the "current" Object and Module part. If you open your gui, then open another module, then push the button, the "current" Object and Module will be the 2nd Module. You need:

  • Module mCurr = current // top of script
  • Object oCurr = curret(mCurr) // inside your callback

As for your question: If you are expecting the user to select some cells in more than one row..
  • void getSelection(mCurr, oFirst, oLast) //looks like it will get the 1st and last selected objects.
  • oNext = next(oNext) // will plow through the selection
  • if (oNext == oLast) then this is the last selected object
  • if (!cell(oNext)) then ignore this row object, which is also selected but you cannot see it.
  • if (oRowDone == row(oNext)) then I've already dealt with this row
  • oRowDone = oRow // when finished with a row

There is also:
  • oTable = table(oCell) // if you need the table header object, and
  • for oRow in oTable do // plow through the rows

But if I read your code correctly, the user will be entering new Text and Revision date, which seems to me to only make sense for a single row.

-Louie

Thank you for response.

I have another question is there a way of creating a gui interface that would allow me to interact with a DOORS table like in MS Excel? I do realize the code would be in-depth but is there a way of creating a spreadsheet interface with DXL?

Thank you,
Jim