Skip to Content
avatar image
Former Member

Opening and closing the same Popup component in Design Studio 1.6.4 to display different charts

Hi,

I am trying to use the same Pop up to display a chart component for which i dynamically change the data selection in the script based on the user selection.

The pop up works fine when it opens the first time but when i close the Pop up (using the close() function) the next pop up behavior is impacted. The chart displays an error "Attach a data source" when the other pop up is opened.

Although, if i close and re-open the pop up again i see the chart correctly. After closure, the same pop-up needs to be opened twice to display data correctly. Please let me know if there is something i am doing incorrectly.

Below are the screenshots of a demo application -

1. The application has two buttons, which open a pop up containing a chart. One button is used to display US data and the other to display UK data in a chart.

2. Upon clicking the US Data button, the pop up is opened displaying the US chart.

3. After closing the previous pop-up and clicking on the UK data button, the following error is displayed.

4. Upon closing the above popup and re-clicking the UK data button, the chart is displayed correctly as shown below.

Add comment
10|10000 characters needed characters exceeded

  • Former Member Tammy Powlas

    Hi Tammy,

    Please find below the properties of the Pop up. I haven't used auto-close as the user needs to be able to close the pop-up manually.

  • I'm on 1.6.4.1 and don't see the Animation property.

    I know you said you want the user to close manually; when I set the Autoclose to true, the user can still close it manually by clicking outside the Popup box. What happens when you try that and remove the POPUP close line?

  • Former Member Tammy Powlas

    Hi Tammy,

    I observed that the whole issue is due to the Close() function. If i click the US/UK buttons without invoking the Close() function no issue is observed.

    As a workaround i instead implemented the functionality with a Panel setting its visibility to true/false and i don't face the error anymore but wondering if there is something i am missing with the Close() function.

  • Get RSS Feed

2 Answers

  • Best Answer
    Jun 07, 2017 at 10:20 AM

    Hi Saleh,

    Sorry about the late follow-up. I have been able to reproduce your issue. If you ask me, it's a bug. However, I have found that the following workaround resolves the issue. Update the code in your Close button to read as follows:

    POPUP_1.close();
    DS_1.reloadData();

    Since there is no change in the underlying data, the reloadData() doesn't actually reload the data, so there is no performance hit but it resolves the "Attach a data source to component" error.

    Regards,

    Mustafa.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Mustafa,

      Thanks for looking into this. The above solution resolves the issue.

      Thanks,
      Waleed

  • Jun 06, 2017 at 01:50 PM

    any update on this ? I am facing exact the same issue.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Gert,

      The solution shared by Mustafa below works. Another way that I had used was that i used a Panel component and fashioned it similar to a popup using the setVisible(true) to show it when it is to be displayed and setVisible(false) when it has to be closed. Hope it helps.

      Thanks,

      Waleed