Skip to Content
0

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

Feb 09, 2017 at 04:41 PM

875

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded

To clarify, are you using the POPUP component? Can you share the properties of your POPUP component? Could you change the Autoclose property to "true"?

1popup.jpg (23.2 kB)
0
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.

0

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?

0
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.

0

Hi Saleh,

It would be helpful for tracking the issue if you could also provide the script code used in each of the 3 buttons: "US Data", "UK Data" and "Close popup".

Regards,

Mustafa.

0
Former Member
Mustafa Bensan

Hi Mustafa,

Below are the scripts i have used for each of the buttons -

"US Data" button code -

INFOCHART_1.setDataSelection({"COUNTRY":"United States"});

POPUP_1.open();

"UK Data" button code -

INFOCHART_1.setDataSelection({"COUNTRY":"United Kingdom"});

POPUP_1.open();

"Close" button code -

POPUP_1.close();

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Mustafa Bensan Jun 07, 2017 at 10:20 AM
0

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.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Mustafa,

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

Thanks,
Waleed

1
Gert Jan Oostrum Jun 06, 2017 at 01:50 PM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Gert,

I just posted a suggested workaround. Hopefully it will resolve your issue as well.

Regards,

Mustafa.

0
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

0