Hi i am writing a simple controller class with code
public class OMTime1 {
public String xx { get; set; }
public PageReference continue1(){
String url='/apex/OneMoreTime?id='+ApexPages.currentPage().getParameters().get('id')+'&process='+xx;
PageReference page=new PageReference(url);
page.setRedirect(true);
return page;
}
}
and a simple VF Page with code
<apex:page controller="OMTime1" >
<!-- Begin Default Content REMOVE THIS -->
<!-- End Default Content REMOVE THIS -->
<apex:form >
<apex:selectList id="chooseColor" value="{!xx}" size="1">
<apex:selectOption itemValue="1" itemLabel="Terminate Resource"/>
<apex:selectOption itemValue="2"
itemLabel="Change Resource Position at Same Location"/>
<apex:selectOption itemValue="3" itemLabel="Change Resource Position with in same Location "/>
<apex:selectOption itemValue="4" itemLabel="Change Resource Position to a Different Location"/>
</apex:selectList>
</apex:form>
<apex:form >
<apex:commandButton value="Continue" action="{!continue1}" id="theButton"/>
</apex:form>
</apex:page>
my task s when user click on button name as Continue page will redirect to it a url /apex/OneMoreTime?id=record_id&process=some_value some_value=1,2,3, or 4 but when i click on button it redirect to /apex/OneMoreTime?id=record_id&process=null
why this null is coming in parameter i want to redirect a value related to label of select option.please suggest way how to resolve it