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}

11 comments:

  1. Hi Anthony, can you add a link to this helpful viewer tip on BIRT Exchange?

    Thanks,
    Virgil

    ReplyDelete
  2. The "code" in my ComboBoxParameterFrament.jsp does not look anything like this. I don't understand what your instruction is. Should I be adding the above code you list, or finding some similar code in my jsp and remove it?

    ReplyDelete
  3. The Syntax Highlighter on the blog is not working properly, and making
    the option tag disappear.
    The brackets { should be changed to <



    Try this:

    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}

    ReplyDelete
  4. I have created a JSP using ParamPage & ParamDef, I cannot remove Null Value from the ListBox, how can I do that?

    ReplyDelete
  5. BTW, I need the ListBox to support Null Values. What I want is changing the label "Null Value" but it is not possible (I could remove the blank space but only in the viewer, I need to remove and replace the text from a JSP)

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. Do we need to add it? or is there something like this in the JSP file which we need to modify? I look around the jsp file but didnt find anything like this.... Please help on this.

    ReplyDelete
  9. can u able to say how to remove Null Value in 4.3 version...

    ReplyDelete