You need to sign in to do that
Don't have an account?
James@KronosLab
Required=false doesn't work for selectoneradio
Create a page called testpage1 with the follow:
<apex:page controller="testController">
<!-- Begin Default Content REMOVE THIS -->
<h1>Congratulations</h1>
This is your new Apex Page: testpage1
<!-- End Default Content REMOVE THIS -->
<apex:form>
<apex:selectoneradio value="{!testVal}" layout="pageDirection" required="false">
<apex:selectitem itemvalue="test1" itemLabel="test Val 1"/>
</apex:selectoneradio>
<apex:commandbutton action="{!nextPage}" value="Next Page"/>
</apex:form>
</apex:page
<!-- Begin Default Content REMOVE THIS -->
<h1>Congratulations</h1>
This is your new Apex Page: testpage1
<!-- End Default Content REMOVE THIS -->
<apex:form>
<apex:selectoneradio value="{!testVal}" layout="pageDirection" required="false">
<apex:selectitem itemvalue="test1" itemLabel="test Val 1"/>
</apex:selectoneradio>
<apex:commandbutton action="{!nextPage}" value="Next Page"/>
</apex:form>
</apex:page
Define testController as:
public class testController {
public PageReference nextPage() {
return Page.testpage2;
}
String testVal;
public String getTestVal() {
return this.testVal;
}
public void setTestVal(String testVal) {
this.testVal = testVal;
}
}
public PageReference nextPage() {
return Page.testpage2;
}
String testVal;
public String getTestVal() {
return this.testVal;
}
public void setTestVal(String testVal) {
this.testVal = testVal;
}
}
You can't get to the second page unless you click on the radio button, in spite of the required="false". If you change it from a selectOneRadio to an inputText, you can get to the second page without a value.
James
I've opened a bug for my team on this and we are investigating. Please note that the earliest we'll be able to deploy a fix will be Winter '08 (and even that release train is getting clode to leaving the station).
Doug