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)
Getting the values of a multi select listbox in onRender - beforeGeneration
abrou001
<p>Good afternoon everyone,</p><p>I am working on a birt report in version 3.7.2 using a parameter that is a multiselect listbox. Current I have been able to get the selections from the listbox in the beforeOpen method of my scripted query using params. Below is a generalized sample of the code.</p><p> </p><p><strong class='bbc'>for </strong>(i = 0; i < params["testCode"].length; i++)</p><p>{</p><p> </p><p><strong class='bbc'>if</strong>(params["testCode"].value
== "First Selected Item")</p><p>{</p><p>filter += 1</p><p> </p><p><strong class='bbc'>if</strong>(params["testCode"].value
== "Second Selected Item")</p><p>{</p><p>filter += 1</p><p>}</p><p>....</p><p>}</p><p> </p><p>I need to do something similar in the onRender - beforeGeneration method to properly label my chart. When I attempted to use params I received an error as I assume this call cannot be used there. So I was able to use the following call below</p><p> </p><p><strong class='bbc'>var </strong>scriptable = icsc.getExternalContext().getScriptable();</p><p>scriptable.getParameterValue("testCode").length</p><p> </p><p>to get length of the array. I have attempted various calls to get the actual value of position
of the array, but have so far been unsuccessful. Any information that anyone might be able to provide would be most appreciated.</p><p> </p><p>Thanks,</p><p> </p><p>Adam Brousseau</p>
Find more posts tagged with
Comments
abrou001
<p>Speaking with one of my coworkers I was able to solve the issue. Below is the code line that I needed to access the array element.</p><p>icsc.getExternalContext().getScriptable().getParameterValue("Test Code")
</p>