Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Remove the null values in a multi-value listbox
Rin
Hi,<br />
<br />
Each time I create a parameter with multi-value checked and is-required unchecked, and make its display type as listbox, the first value in the listbox will always be a blank, and the second value is always be "Null Value" , (both static or dynamic parameter),I have tried a lot of different ways to remove it but none of them works.<br />
<br />
I modified ComboBoxParameterFragment.jsp in webapps\birt\webcontent\birt\pages\parameter, replace the IBirtConstants.NULL_VALUE in line 143, and IBirtConstants.NULL_VALUE_DISPLAY in line 144 with "123":<br />
<br />
<strong class='bbc'>String outputValue = ParameterAccessor.htmlEncode(( value == null)?"123":value);<br />
String outputLabel = ParameterAccessor.htmlEncode(( label == null)?"123":label);<br />
</strong><br />
then run the report again, the blank and null value is still there....<br />
<br />
Then I do sth like:<br />
<strong class='bbc'>String outputValue = ParameterAccessor.htmlEncode(( value == null)?IBirtConstants.NULL_VALUE:value);<br />
String outputLabel = ParameterAccessor.htmlEncode(( label == null)?"123":"123");</strong><br />
<br />
This time all the values in the list box became display as "123", but the blank line and "Null Value" are still there, in the first and second line of the parameter list box!<br />
<br />
<br />
An interesting thing is: when I check the is-required, the blank and null-value will all gone...<br />
<br />
I'm using birt-runtime-2_6_2, and same problem with 3.7
Find more posts tagged with
Comments
mwilliams
The "null value" is there when it's not required so that there is an option for passing a null value. It's just the way the sample viewer handles it. Is using a "required" parameter not an option? You could include a default of "No Value" or something like that. This way there is something selected to pass whether the user selects something or not. Another option if you aren't able to edit the parameter jsp pages to remove the null option would be to create your own parameter page using the viewer taglib.
Rin
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="79262" data-time="1309292467" data-date="28 June 2011 - 01:21 PM"><p>
The "null value" is there when it's not required so that there is an option for passing a null value. It's just the way the sample viewer handles it. Is using a "required" parameter not an option? You could include a default of "No Value" or something like that. This way there is something selected to pass whether the user selects something or not. Another option if you aren't able to edit the parameter jsp pages to remove the null option would be to create your own parameter page using the viewer taglib.<br /></p></blockquote>
<br />
Thank you mwilliams,<br />
<br />
Checking the "required" is an option, but after I set a default value for the parameter, the default value will not be displayed in the parameter listbox(But the value of <strong class='bbc'>params["name"].value[0]</strong> is exactly the default value I set). Hence the user still have to select something from the listbox to run the report....<br />
<br />
<br />
I tried to create my own parameter page, but another problem arouse, I post it in <br />
<a class='bbc_url' href='
http://www.birt-exchange.org/org/forum/index.php/topic/22715-dynamic-parameters-with-drill-through/'>http://www.birt-exchange.org/org/forum/index.php/topic/22715-dynamic-parameters-with-drill-through/</a>
;
mwilliams
When you set a default value, it doesn't show as a default value in the parameter page? I think I've seen this issue before, but I couldn't remember what version it was in. Does this same thing happen in 3.7.0 when setting a default value?
Rin
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="79268" data-time="1309295629" data-date="28 June 2011 - 02:13 PM"><p>
When you set a default value, it doesn't show as a default value in the parameter page? I think I've seen this issue before, but I couldn't remember what version it was in. Does this same thing happen in 3.7.0 when setting a default value?<br /></p></blockquote>
<br />
No, it doesn't shown as a default value in the parameter page. <br />
But for listbox of static parameter, the default values will be in the listbox.<br />
<br />
Same with 3.7. : <
mwilliams
So, the problem only happens when it is a dynamic parameter? Or when it is multi-select? Or what? I think I remember the issue I saw only happening when the report was multi-select. I could be wrong though. Let me know. Then, please log this bug at
http://www.birt-exchange.org/org/resources/bug-reporting/
and post the bug info in here. Thanks!
Rin
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="79414" data-time="1309449929" data-date="30 June 2011 - 09:05 AM"><p>
So, the problem only happens when it is a dynamic parameter? Or when it is multi-select? Or what? I think I remember the issue I saw only happening when the report was multi-select. I could be wrong though. Let me know. Then, please log this bug at <a class='bbc_url' href='
http://www.birt-exchange.org/org/resources/bug-reporting/'>http://www.birt-exchange.org/org/resources/bug-reporting/</a>
; and post the bug info in here. Thanks!<br /></p></blockquote>
<br />
Hi,<br />
<br />
It happens only with dynamic parameters, no matter it is multi-select or not.<br />
<br />
Bug reported : D
kushal2605
Even i Was going through Comboboxparameterfragment.jsp but i wasn't able to figure out from where this null value is coming.
can u please let me know if u hv any knowledge about it.