I have a PF's selectOneRadio to choose a file type to download. Also I have a commandButton to call a download servlet using onclick attribute. The problem is that when I choose file type and click the button, the chosen value is of course not yet submitted. I'm looking for some way to get the chosen value available when I click on a download button.
Here's my code:
<p:selectOneRadio id="sorType" value="#{bean.type}" layout="custom">
<f:selectItem itemLabel="XML" itemValue="XML" />
<f:selectItem itemLabel="XLS" itemValue="XLS" />
<f:selectItem itemLabel="CSV" itemValue="CSV" />
</p:selectOneRadio>
<p:commandButton type="button" ajax="false" onclick="return downloadFile('#{bean.type}');" />