title: BIRT Combo Box dynamic default value
body: <p>I have a BIRT combo box backed by a dataset with a dynamic query, defined in its beforeOpen script.</p>
  
  <p>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>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>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><code>var values = this.getValueList(); // This is the part I'm missing
  var defaultValues = [];
  defaultValues[0] = values[values.length - 1];
  </code></pre>
  
  <p>Thanks in advance,</p>
  
  <p>Fran</p>