You need to sign in to do that
Don't have an account?
Rishav
I want to update my outputpanel field on the basis of selected checkboxes value;
i want to update my output panel after checking the chckbox but i am unable to do it . help me.
<apex:page controller="test2">
<apex:form >
<apex:selectCheckboxes value="{!countries}">
<apex:selectOptions value="{!country}"></apex:selectOptions>
<apex:actionSupport reRender="zip" event="onchange" action="{!test}"/>
</apex:selectCheckboxes>
<apex:outputPanel id="zip">
hello {!name}
</apex:outputPanel>
</apex:form>
</apex:page>
--------------------------------------------
public class test2 {
public string countries{get;set;}
public string name {get;set;}
public test2()
{
counter = 0;
}
public list<selectoption> getcountry()
{
list<selectoption>options = new list<selectoption>();
options.add(new selectoption('india','india'));
return options;
}
public pageReference test()
{
if(countries == 'India')
{
name= ' kumar';
}
return null;
}
}
<apex:page controller="test2">
<apex:form >
<apex:selectCheckboxes value="{!countries}">
<apex:selectOptions value="{!country}"></apex:selectOptions>
<apex:actionSupport reRender="zip" event="onchange" action="{!test}"/>
</apex:selectCheckboxes>
<apex:outputPanel id="zip">
hello {!name}
</apex:outputPanel>
</apex:form>
</apex:page>
--------------------------------------------
public class test2 {
public string countries{get;set;}
public string name {get;set;}
public test2()
{
counter = 0;
}
public list<selectoption> getcountry()
{
list<selectoption>options = new list<selectoption>();
options.add(new selectoption('india','india'));
return options;
}
public pageReference test()
{
if(countries == 'India')
{
name= ' kumar';
}
return null;
}
}
<apex:page controller="test2">
<apex:form >
<apex:selectCheckboxes value="{!countries}">
<apex:selectOptions value="{!country}"></apex:selectOptions>
<apex:actionSupport reRender="zip" event="onchange" action="{!test}"/>
</apex:selectCheckboxes>
</apex:form>
<apex:outputPanel id="zip">
hello {!name}
</apex:outputPanel>
</apex:page>
-------------------------
public class test2 {
public integer counter{get;set;}
String[] countries = new String[]{};
public string name {get;set;}
public test2()
{
counter = 0;
}
public list<selectoption> getcountry()
{
list<selectoption>options = new list<selectoption>();
options.add(new selectoption('india','india'));
return options;
}
public pageReference test()
{
if(!countries.isEmpty() && countries[0] == 'india')
{
name= ' kumar';
}
return null;
}
public String[] getCountries() {
return countries;
}
public void setCountries(String[] countries) {
this.countries = countries;
}
}
All Answers
http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_actionRegion.htm
This is not the solution of my problem.
<apex:page controller="test2">
<apex:form >
<apex:selectCheckboxes value="{!countries}">
<apex:selectOptions value="{!country}"></apex:selectOptions>
<apex:actionSupport reRender="zip" event="onchange" action="{!test}"/>
</apex:selectCheckboxes>
</apex:form>
<apex:outputPanel id="zip">
hello {!name}
</apex:outputPanel>
</apex:page>
-------------------------
public class test2 {
public integer counter{get;set;}
String[] countries = new String[]{};
public string name {get;set;}
public test2()
{
counter = 0;
}
public list<selectoption> getcountry()
{
list<selectoption>options = new list<selectoption>();
options.add(new selectoption('india','india'));
return options;
}
public pageReference test()
{
if(!countries.isEmpty() && countries[0] == 'india')
{
name= ' kumar';
}
return null;
}
public String[] getCountries() {
return countries;
}
public void setCountries(String[] countries) {
this.countries = countries;
}
}
thanks for your response, yes you are correct, i was making mistake by treting a list as a string but later i corrected it in the same fashion as you have described.