function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
OnkiOnki 

Get selected checkbox value in other VF page using wizard

Hi

 

How can i pass selected checkbox value from one page to other page using wizard. 

prageethprageeth

I don't know whether I have understood your question correctly. 

CheckBox value is a Boolean and you can pass this value between pages as you pass other variable values.

Following is an example.

 

Controller: 

  public class MyClass{

Boolean isSelected = true;

public void setIsSelected(Boolean b) { //this sets the selected value from your checkbox

this.isSelected = b;

}

public Boolean getIsSelected() { //this gets the selected value to the second page

return this.isSelected;

}

public PageReference goToNextPage() { //button action

PageReference pageRef = Page.Page2;

return pageRef.setRedirect(false)

} 

  } 

 

  Page1:

  <apex:page Controller="MyClass">

<apex:form>

<apex:inputCheckbox value="{!isSelected}" />select me

<apex:commandButton action="{!goToNextPage}" value="Next Page" />

</apex:form> 

</apex:page> 

 

Page2: 

<apex:page controller="MyClass">

Selected status = "{!isSelected}"

</apex:page> 

 

>> Instead of the above method you can pass the value as a URL parameter.

>> If you need to maintain a list of checkBox values, you may need to use an Inner Class.