Quantcast
Channel: SCN : Discussion List - SAP BusinessObjects Design Studio
Viewing all articles
Browse latest Browse all 4041

Chart getSelectedMember() not working with Custom Data Sources

$
0
0

Hello SAP Community,

 

We are building a custom data source extension using the new Data Source SDK in Design Studio 1.4. We have the vast majority of things working well (with some help from SCN!)

 

However we are having an issue with getSelectedMember() and getSelectedMembers() on charts bound to our custom data source. An attempt to call these methods on the chart's On Select event causes an error with getSelectedMember(), and returns an empty array with getSelectedMembers().

 

The error we see with getSelectedMember() is 'org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException'.

 

This is how you can recreate this scenario:

  1. You need to have the Design Studio 1.4 SDK examples up and running.
  2. Create a new Design Studio application.
  3. Add a custom data source of type Static Data Source.
  4. Drag Chart from the Analytics Components on to your application canvas.
  5. Find the Data Source property on your new Chart and select your Static Data Source in the drop down (most likely DS_1). You should see your Chart display a column chart with A, B and C along the x-axis.
  6. Find the On Select property on your Chart, and press the Edit the script button.
  7. Place the following code into the script box and press the OK button.
    var selectedItem = CHART_1.getSelectedMember("cols");
  8. Save your application.
  9. Preview your application by pressing the Execute Locally button on the toolbar.
  10. Click on a column of data in your chart in the version of the application that launches in a web browser.
  11. You will see an error appear at the bottom right of your application.
  12. Back in the Design Studio designer, in the Error Log window, you will see the NullPointerException error mentioned above.

 

You can alter the script in the On Select property of the chart to use getSelectedMembers(), and you will see that it returns a 0 length array.

var selectedItems = CHART_1.getSelectedMembers("cols");
APPLICATION.alert("Length " + selectedItems.length);

When you select a column in the chart, you will see that the length of the array is zero.

 

So my questions for discussion are:

  1. Are we doing something wrong? If we are, what is the correct way of doing it?
  2. Can anyone else confirm this is an issue?

 

Kind regards,
Mark Bain.


Viewing all articles
Browse latest Browse all 4041

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>