Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Dashboard Data Selector Value for HTML Button
tmontano
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">Hello,</p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;"> </p>
<p style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">I have a working dashboard with a few charts that are working with a data object with a data selector that filters documents based on file extension. I would like to implement a button that makes an ajax call to a web-service that updates a database with the extension selected. I have tried numerous things: blank report gadget with an html button that accesses a data binding, a parameter gadget, I also tried linking the data selector gadget to my report but I cannot get the list of fields to showup. What would be the best way to create a button that can access the data selector selection and make an ajax request to a web-service?</p>
<div> </div>
Find more posts tagged with
Comments
shiloam
<p><span style="font-size:12px;"><span style="font-family:arial, helvetica, sans-serif;">I think the easiest way to do what you want would be to choose one of the linked charts/visualizations, go to the 'link' menu, and customize the onChange event. The method looks like this:</span></span></p>
<p> </p>
<p><span style="font-size:12px;"><span style="font-family:arial, helvetica, sans-serif;"><span style="color:rgb(0,0,0);">function onChange ( event, publisher, data, thisGadget ){}</span></span></span></p>
<p> </p>
<p><span style="font-size:12px;"><span style="font-family:arial, helvetica, sans-serif;"><span>The value selected by the selector you want to capture is in the 'data' variable. Capture it and populate a global Javascript page variable.</span></span></span></p>
<p> </p>
<p><span style="font-size:12px;"><span style="font-family:arial, helvetica, sans-serif;">BIRT Dashboards support the use of custom Google gadgets. Put your button in one and call a Javascript function in the onClick event of the button which utilizes the page variable that you captured from the onChange method of the customized link. </span></span></p>
<p> </p>
<p>A custom Google gadget btw is really just an XML file that you can include using the 'import gadget' option from the 'extras' section. A skeleton Google gadget with nothing but a div and an alert looks like this:</p>
<p> </p>
<div><?xml version="1.0" encoding="UTF-8"?></div>
<div><!--</div>
<div> * Licensed to the Apache Software Foundation (ASF) under one</div>
<div> * or more contributor license agreements. See the NOTICE file</div>
<div> * distributed with this work for additional information</div>
<div> * regarding copyright ownership. The ASF licenses this file</div>
<div> * to you under the Apache License, Version 2.0 (the</div>
<div> * "License"); you may not use this file except in compliance</div>
<div> * with the License. You may obtain a copy of the License at</div>
<div> *</div>
<div> * <a data-ipb='nomediaparse' href='
http://www.apache.org/licenses/LICENSE-2.0'>http://www.apache.org/licenses/LICENSE-2.0</a></div>
;
<div> *</div>
<div> * Unless required by applicable law or agreed to in writing,</div>
<div> * software distributed under the License is distributed on an</div>
<div> * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</div>
<div> * KIND, either express or implied. See the License for the</div>
<div> * specific language governing permissions and limitations</div>
<div> * under the License.</div>
<div>--></div>
<div><Module></div>
<div><ModulePrefs title="Sample PubSub Subscriber"</div>
<div> height="250"></div>
<div><Require feature="pubsub"/></div>
<div></ModulePrefs></div>
<div><Content type="html"></div>
<div><![CDATA[</div>
<div> </div>
<div><script></div>
<div>alert("I'm a custom gadget!");</div>
<div> </div>
<div><div><span> </span></div>
<div></div><span> </span></div>
<div> </div>
<div>]]></div>
<div></Content></div>
<div></Module></div>