So in one of my DXLs, I have a list of Modules to chose from as a list and then to the right of it, there is a list of the baselines for the selected module. At the bottom, once you click on the add button it gives you the option to create a new baseline. It is creating the new baseline, but it is not updating the baselines for the selected module. For me to get it to update, I have to click on one of the modules in the left hand list. I've been looking for something that may update said Dialog box, but with no luck. Is there maybe a function or something I would have to do to get this dialog box to update without me having to click on a module? |
Re: Dialog box is not updating...
How about just calling the select callback of the list, after creating the baseline? Or am I thinking to simple? Regards, Mathias
DB modulesBox = create "Modules"
string moduless[] = {"Module 1", "Module2","Module 3"}
DBE modulesList = list(modulesBox, "Choose one of:", 5, moduless)
void getBaselines(DBE modulesList) { ack "Updating list!" }
void cbAddOne (DBE x) { getBaselines(x) /* update the list */ }
// Button updates the list too!
button (modulesBox, "make baseline", cbAddOne)
set(modulesList, getBaselines)
show modulesBox
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Dialog box is not updating... Mathias Mamsch - Sat Mar 12 16:46:22 EST 2011
How about just calling the select callback of the list, after creating the baseline? Or am I thinking to simple? Regards, Mathias
DB modulesBox = create "Modules"
string moduless[] = {"Module 1", "Module2","Module 3"}
DBE modulesList = list(modulesBox, "Choose one of:", 5, moduless)
void getBaselines(DBE modulesList) { ack "Updating list!" }
void cbAddOne (DBE x) { getBaselines(x) /* update the list */ }
// Button updates the list too!
button (modulesBox, "make baseline", cbAddOne)
set(modulesList, getBaselines)
show modulesBox
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
void on_moduleselect (DBE modlst) { No where in the function is modlist being used. Inside this DXL there is only one instance in which this function is called. The time this function is called is as follows: set(moduleList, on_moduleselect) Where moduleList is the dialog box that lists the modules. My intention was to run the function on_moduleselect on it's own as soon as the new baseline is being created. Except when I do this, I get on_module select to be an undeclared variable. I've tried many things such as just copying and pasting the instance in which it is already called, but I still get the error of it being an undeclared variable. Any help would be appreciated. Thanks Eric |
Re: Dialog box is not updating... Eric_Hillen - Tue Mar 15 10:45:44 EDT 2011
Probably the function moduleselect is declared inside another function or after the function where you are trying to call it. If this is the case its scope is limited to the function, and any try to call it will result in an undeclared variable error. Example:
void ButtonCallback (DBE x) {
// make baseline ...
create (m, nextMajor(""), ...)
// call update function - undeclared variable!
on_moduleselect (lv)
}
DB makeDialog () {
void on_moduleselect (DBE x) {
// update the baseline listview
...
}
DB dialog = create "..."
DBE lv = listView (...)
// set the callback
set(lv, on_moduleSelect, doNothing, doNothing)
//
button (dialog, "Make Baseline", ButtonCallback)
}
void on_moduleselect (DBE x) {
// update the baseline listview
...
}
void ButtonCallback (DBE x) {
// make baseline ...
create (m, nextMajor(""), ...)
// call update function - undeclared variable!
on_moduleselect (lv)
}
DB makeDialog () {
DB dialog = create "..."
DBE lv = listView (...)
// set the callback
set(lv, on_moduleSelect, doNothing, doNothing)
//
button (dialog, "Make Baseline", ButtonCallback)
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Dialog box is not updating... Eric_Hillen - Tue Mar 15 10:45:44 EDT 2011
Mathias is probably right about the scope.
string s_Global = ""
void FunctionMain()
{
string LocalToMain = ""
void FunctionSub()
{ // Function embedded in FunctionMain()
string a = s_Global // OK, can see s_Global
string b = LocalToMain // FAIL
FunctionMain() // OK
} // end FunctionSub()
}
|
Re: Dialog box is not updating... llandale - Tue Mar 15 13:32:23 EDT 2011
Mathias is probably right about the scope.
string s_Global = ""
void FunctionMain()
{
string LocalToMain = ""
void FunctionSub()
{ // Function embedded in FunctionMain()
string a = s_Global // OK, can see s_Global
string b = LocalToMain // FAIL
FunctionMain() // OK
} // end FunctionSub()
}
Thanks Eric |
Re: Dialog box is not updating... llandale - Tue Mar 15 13:32:23 EDT 2011
Mathias is probably right about the scope.
string s_Global = ""
void FunctionMain()
{
string LocalToMain = ""
void FunctionSub()
{ // Function embedded in FunctionMain()
string a = s_Global // OK, can see s_Global
string b = LocalToMain // FAIL
FunctionMain() // OK
} // end FunctionSub()
}
Did you check that the on_moduleselect is actually defined before the piece of code, where you want to call it? This is supposed to work, and I really cannot think about another reason other than misspelling or wrong scope for a "undeclared variable" message. In very rare cases you can get pseudo DXL error messages from DXL layouts, or attribute DXLs that seem to belong to your program but really occur in a Layout or Attribute DXL when your module opens another module. Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |