Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cognos script-dialog box functions 1

Status
Not open for further replies.

aminaalavi

Programmer
May 22, 2003
15
0
0
FR
I have created a dialog box. Once a button ( other than "OK" and "cancel") on the dialog box is clicked, the dialog box closes. What do i do if i want ot keep the dialog box open even after the button is clicked. My code is given below:

sub showdlg1()
Begin Dialog UserDialog1 25, 7, 591, 316, "MAIN MENU"
ButtonGroup .ButtonGroup1
PushButton 217, 178, 155, 28, "HELP"
CancelButton 319, 243, 73, 17
Picture 208, 33, 179, 31, "mainmenu.BMP", 0
End Dialog





Dim mydialogbox1 As UserDialog1
answer1= Dialog(mydialogbox1)

Select Case answer1

Case 1
call helpdlgbox


End Select

end sub


Thanks

Amina
 
Amina,

CognosScript dialog boxes are not modal. This means that execution stops while the dialog is present. That said, you can force the dialog to reappear after a button is pressed by putting the execution line within a loop statement. I often do this when validating a text-based date prompt.

There is a dialog function available that allows limited execution while the dialog runs. This is commonly used to provide defaults and to enable or disable dialog controls based on what the user is doing while the dialog is still running. You may want to investigate these to see if they can meet your needs.

If all you want to do is present another dialog screen for help text, just define that dialog box and call it when the help button is pressed. Then re-execute the main dialog when the user closes the help dialog.

Hope this helps,

Dave Griffin



The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ20-2863 first!
 
Brillaint Dave! that was very helpful.
Just one more question, How do i know the user closed the help screen so that i can re-execute the main dialog when the user closes the help dialog.

Thanks
Amina

 
Amina,

The process is linear. Place the execution line for the Main dialog box in a loop statement. When the user presses the 'Help' button, the help dialog box will execute (you provide the code for this). While the Help dialog box is up, the main dialog is closed. After the user closes the Help dialog (with the OK button) the code runs to the end of the loop, repeats, and re-executes the Main dialog box. Only exit the loop if the Main dialog return function is OK or Cancel. The documentation and especially the help files provide good examples.

Regards,

Dave Griffin




The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ20-2863 first!
 
Thanks Dave,

I really appreciate your help

cheers
Amina
 
Dave's the man! Your wisdom is much appreciated by everyone....he truly is, (among other things), an Impromptu guru....

{Insert Revered Bow Action Here}



Pedro Cardoso
A.K.A CanadianTechie
[pc2]
 
Thnx for the kudos Pedro. If any of the TT users will be at the Cognos Tech Forum in Florida June 8-10th, feel free to look me up there. I'll be staying at the event hotel. Leave me a message at the hotel and I'll meet you for a beer (or whatever!) [cheers].

Regards,

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ20-2863 first!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top