LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Return to previous popup from second popup

Hi All,

 

I use InstallPopup to display one on the panels in my UI. This panel again opens another panel as a popup. However, when I exit the second panel using RemovePopup(0), and try any user event on first panel I get "Invalid control ID" error. I am unable to figure out what could be wrong. Do I need to use another command along with RemovePopUp(0) to go back to first popup ?

 

Regards,

Kanu

0 Kudos
Message 1 of 5
(3,081 Views)

Hi Kanu,

this is definitely not the expected behaviour: CVI is able to maintain independent instances of each panel and installing a popup and removing it should not cause errors, provided you save each panel handle in persistent variables so that you do not loose any of them while the panel is loaded in memory.

 

Have you tested the panel handles you are using when you install / uninstall the popups and when you get the error?

 

Can you post the relevant part of your code for we to examine it?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 5
(3,076 Views)

Hi Roberto,

 

Thanks for your reply. I am really bugged with this error. I have been trying to debug the code, but no success yet. I have comboboxes in first popup. A menu bar item in first popup is used to call the second popup where again I populate a combobox. PopUp2 is closed only when Ok is clicked and thus user goes back to Popup1. I observed that it is not for all comboboxes of PopUp1 "Invalid Control Id" error comes. Further, this error happens only if more than one user event gets committed in second popup. Does these give any clue as to what is happening ?  The code looks like the following:

 

// Button click to Open popup 1 and populate its combo boxes

InstallPopup (gPopUp1);

fnPopulateCombo2(gPopUp1, cbExample1); 

fnPopulateCombo2(gPopUp1, cbExample2); 

.

.

.

// Wait for user event of Ok button click in popup 1 to proceed further with code

 

 

 

// Menu bar item callabck

InstallPopup (gPopUp2);
// Populate combo box

 

 

 

// Ok button callback from PopUp2

// Reads data from controls and closes PopUp2

 

 

I will appreciate if you could suggest something.

 

Regards,

Kanu

 

0 Kudos
Message 3 of 5
(2,981 Views)

Hi All,

 

I used a command button in first popup to go to second popup and this did not give me any error. Now, this has left me wondering if I am missing some command while calling second popup with menubar item. I am still not able to figure out why I get "Invalid control id" error with menubar. I will appreciate if someone can suggest what the possible problem could be ?

 

Regards,

Kanu

0 Kudos
Message 4 of 5
(2,977 Views)

I build up a simple example that uses two popups and handles their opening and closing. I suppose it is more or less what you are doing in your application. I am not using any global variable to store panel handles in the code: note the use of callbackData parameter to pass the panel handle to the last popup that writes data to the second one. As I told you, not passing the correct handles to SetCtrlVal or other functions can lead to the type of errors you are seeing: maybe you are running into this type of problem?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 5 of 5
(2,963 Views)