Friday, January 9, 2009

Removing the 'Null' Text in ComboBox or ListBox Parameters

In BIRT 2.3.1, it is possible to modify or hide the 'Null' Text value that is generated
when you create a ComboBox or ListBox Parameter.

*Update to this Post* The syntax highlighter is not working properly.
The XML tag brackets have been replaced with { }

Go to the BIRT WebViewer JSP page in
\webcontent\birt\pages\parameter .

Find ComboBoxParameterFragment.jsp in the viewer and edit the JSP to remove the space and the Null Text Value (i.e. IBirtConstants.NULL_VALUE)



if ( !parameterBean.isRequired( ) )
{
if( allowMultiValue )
{
if( DataUtil.contain( values, null, true ) )
{
%>

{option title="">" SELECTED VALUE=""}{/option}

{option title="">" VALUE=""}{/option}

{option title="">" VALUE="" ??% : ?SELECTED? )? null paramValue="=" {/option}