I’ve had to dig for the correct way to use this a few times now, so I am putting it here as a keepsake:
<bean:withBean beanName="page1Command">
<bean:field property="postcode"/>
<bean:select property="businessType"/>
<bean:field property="campaignStart" precision="month"/>
<bean:field property="campaignEnd" precision="month"/>
<bean:select property="campaignSize" from="${Constants.CAMPAIGNSIZES}"
noSelection="['':'Choose the Campaign Size']"
onchange="${remoteFunction(action:'ajaxCampaign',params:'\'campaignSize=\'+escape(this.value)+\'&postcode=\'+this.form.postcode.value',onFailure:'handleFailure(e);',onSuccess:'updateCampaignSizes(e);')}"/>
</bean:withBean>
The tricky bit (although it doesn’t look like it) is getting multiple parameters passed through successfully. Always gives me trouble. Other people too.
PS: Kudos to Marc Palmer for his Bean-Fields Plugin (shown above). A real time-saver.
