BIRT Combo Box dynamic default value
<p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">Hi,</p><p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"> </p><p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">I have a BIRT combo box backed by a dataset with a dynamic query, defined in its beforeOpen script.</p><p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"> </p><p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">What I want to do next is to set the last value from the dataset as the default value in the combo box.</p><p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"> </p><p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">For example, if my dataset returns the values [1, 2, 3] then I want the combo box to have the value 3 preselected.</p><p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"> </p><p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">I guess I need to add logic in the getDefaultValueList script of the parameter, but I don't know how to get the value list programmatically. Id'd like to achieve something like the following:</p><pre class="_prettyXprint">var values = this.getValueList(); // This is the part I'm missingvar defaultValues = [];defaultValues[0] = values[values.length - 1];</pre><p>Thanks in advance,</p><p> </p><p style="color:rgb(0,0,0);font-family:Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;">Fran</p>