A parameter that I am developing for my plugin requires two select fields, the second one being populated using the value selected from the dropdown list of the first field. My problem is that I don't know how to repopulate the list for the second field.
I've got as far as detecting the change in the first field but I don't know how to force a refresh of the second field;
ParameterDefinition - index.jelly
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define"
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"
xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
<j:set var="escapeEntryTitleAndDescription" value="false"/>
<f:entry title="${h.escape(it.name)}" description="${it.formattedDescription}">
<div name="parameter">
<input type="hidden" name="name" value="${it.name}" />
<select name="applicationId" onchange="alert('what do I do here?');">
<j:forEach var="item" items="${it.applications}">
<option value="${item.value}">${item.name}</option>
</j:forEach>
</select>
<select name="releaseNumber">
<j:forEach var="item" items="${it.releases}">
<option value="${item.value}">${item.name}</option>
</j:forEach>
</select>
</div>
</f:entry>
</j:jelly>
I'm also wondering if this is the best approach. I could potentially split this out into two seperate fields, however I then need to replicate the behaviour of the active choices plugin and that sounds a bit daunting...
Any suggestions?