You need to sign in to do that
Don't have an account?
Reddy
public class AccountInformation {
public AccountInformation(HelpEXample controller) {
}
public string name{set;get;}
public string industry{set;get;}
public string AccountNumber{set;get;}
public string selectedCountry{set;get;}
public Account acc {get;set;}
public AccountInformation()
{
acc = new Account();
}
public list<selectoption> getCountrysOptions(){
list<selectOption> so=new list<selectOption>();
so.add(new selectOption('','-none'));
so.add(new selectOption('INDIA','india'));
so.add(new selectOPtion('USA','usa'));
so.add(new selectOPtion('UK','uk'));
return so;
}
public PageReference Save()
{
insert acc ;
return new PageReference('/'+acc.id);
}
}
<apex:page Controller="AccountInformation" tabStyle="Account" >
<apex:form >
<apex:pageblock title="Account Details" mode="edit">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="save"/>
<!--
<apex:commandButton action="{!new}" value="new" />
<apex:commandButton action="{!delete}" value="delete" />
-->
</apex:pageBlockButtons>
<apex:pageBlockSection title="My Data section" columns="2">
<apex:inputField value="{!acc.name}"/>
<apex:inputField value="{!acc.accountNumber}"/>
<apex:inputField value="{!acc.industry}" />
<apex:outputLabel value="Enter country"/>
<apex:selectlist value="{!selectedCountry }" size="1">
<apex:selectoption itemvalue="-NONE-" itemlabel="none"></apex:selectoption>
<apex:selectOption itemvalue="INDIA" itemlabel="india"></apex:selectOption>
<apex:selectoption itemvalue="USA" itemlabel="usa"></apex:selectoption>
<Apex:selectoption itemvalue="UK" itemlabel="uk"></Apex:selectoption>
</apex:selectlist>
</apex:pageBlockSection>
</apex:pageblock>
</apex:form>
</apex:page>
just check it how to solved
public class AccountInformation {
public AccountInformation(HelpEXample controller) {
}
public string name{set;get;}
public string industry{set;get;}
public string AccountNumber{set;get;}
public string selectedCountry{set;get;}
public Account acc {get;set;}
public AccountInformation()
{
acc = new Account();
}
public list<selectoption> getCountrysOptions(){
list<selectOption> so=new list<selectOption>();
so.add(new selectOption('','-none'));
so.add(new selectOption('INDIA','india'));
so.add(new selectOPtion('USA','usa'));
so.add(new selectOPtion('UK','uk'));
return so;
}
public PageReference Save()
{
insert acc ;
return new PageReference('/'+acc.id);
}
}
<apex:page Controller="AccountInformation" tabStyle="Account" >
<apex:form >
<apex:pageblock title="Account Details" mode="edit">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="save"/>
<!--
<apex:commandButton action="{!new}" value="new" />
<apex:commandButton action="{!delete}" value="delete" />
-->
</apex:pageBlockButtons>
<apex:pageBlockSection title="My Data section" columns="2">
<apex:inputField value="{!acc.name}"/>
<apex:inputField value="{!acc.accountNumber}"/>
<apex:inputField value="{!acc.industry}" />
<apex:outputLabel value="Enter country"/>
<apex:selectlist value="{!selectedCountry }" size="1">
<apex:selectoption itemvalue="-NONE-" itemlabel="none"></apex:selectoption>
<apex:selectOption itemvalue="INDIA" itemlabel="india"></apex:selectOption>
<apex:selectoption itemvalue="USA" itemlabel="usa"></apex:selectoption>
<Apex:selectoption itemvalue="UK" itemlabel="uk"></Apex:selectoption>
</apex:selectlist>
</apex:pageBlockSection>
</apex:pageblock>
</apex:form>
</apex:page>
use this code .
<apex:pageBlockSection title="My Data section" columns="2">
<apex:inputField value="{!acc.name}"/>
<apex:inputField value="{!acc.accountNumber}"/>
<apex:inputField value="{!acc.industry}" />
<apex:selectlist label="Enter country" value="{!selectedCountry }" size="1">
<apex:selectoption itemvalue="-NONE-" itemlabel="none"></apex:selectoption>
<apex:selectOption itemvalue="INDIA" itemlabel="india"></apex:selectOption>
<apex:selectoption itemvalue="USA" itemlabel="usa"></apex:selectoption>
<Apex:selectoption itemvalue="UK" itemlabel="uk"></Apex:selectoption>
</apex:selectlist>
</apex:pageBlockSection>
Replace in your code pageblock section .
Regards ,
Harish.R.
it's happen because you use <apex:outputlabel> in your code ,
use label attribute in <apex:selectlist label="enter country" value="{!selectedCountry }" size="1">
you have not need to use <apex:ouputlabel for display lable.
output
thanks
let me inform if it helps you :)
public class AccountInformation {
public AccountInformation(HelpEXample controller) {
}
public List<Account> accLst {get; set;}
public List<Account> accLst_size {get; set;}
public string name{set;get;}
public string industry{set;get;}
public string AccountNumber{set;get;}
public string selectedCountry{set;get;}
public Account acc {get;set;}
public integer counter=0;
public integer recNum=0;
public integer limits =10;
public set<id> AccountId{set;get;}
public AccountInformation()
{
acclist = new list<Account>();
acclist__size=new list<Account>();
Account id=new set<id>();
Result();
}
public void Result(){
acclist__size=[select id,name,country__c,industry from Account where name !=null];
acclist__size=acclist__size.size();
}
public void searchresult(){
system.debug('number of records' +recNum);
acclist=[select id,name,country__c,industry from Account where id in: Accountid and name !=null];
}
public void nxtbtn(){
counter +=limits();
searchresult();
}
public void prvbtn(){
counter -=limits();
searchresult();
}
public void frtbtn(){
counter=0;
searchresult();
}
public void endbtn(){
counter=recNum-math.mode(recNum,limits);
searchResult();
}
public void boolean getprv(){
if counter==0;
return true;
else
return false;
}
public void getnxt(){
if((counter+limits)>recNum)
return true;
else
return false;
}
public list<selectoption> getCountrysOptions(){
list<selectOption> so=new list<selectOption>();
so.add(new selectOption('','-none'));
so.add(new selectOption('INDIA','india'));
so.add(new selectOPtion('USA','usa'));
so.add(new selectOPtion('UK','uk'));
return so;
}
public PageReference Save()
{
insert acc ;
return new PageReference('/'+acc.id);
}
}
-----------------------------------------------------------
vf page:-
<apex:page Controller="AccountInformation" tabStyle="Account" >
<apex:form >
<apex:pageblock title="Account Details" mode="edit">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="save"/>
<!-- <apex:commandButton action="{!search}" value="search"/>
<apex:commandButton action="{!new}" value="new" />
<apex:commandButton action="{!delete}" value="delete" /> -->
</apex:pageBlockButtons>
<apex:dataTable value="{!acclist}" var="acc">
<apex:column headerValue="name">
<apex:outputField value="{!acc.name}"/>
</apex:column>
<apex:column headerValue="id">
<apex:outputField value="{!acc.id}"/>
</apex:column>
<apex:commandButton value="{!Fst}" action="frtbtn" disabled="{!prv}"/>
<apex:commandButton value="{!Prv}" action="prvbtn" disabled="{!prv}"/>
<apex:commandButton value="{!Next}" action="nxtbtn" disabled="{!nxt}" />
<apex:commandButton value="{!End}" action="endbtn" disabled="{!nxt}" />
<apex:pageBlockSection title="My Data section" columns="2">
<apex:inputField value="{!acc.name}"/>
<apex:inputField value="{!acc.accountNumber}"/>
<apex:inputField value="{!acc.industry}" />
<apex:selectlist Label ="Enter country" value="{!selectedCountry}" size="1">
<apex:selectOption itemvalue="-NONE-" itemlabel="none"></apex:selectoption>
<apex:selectOption itemvalue="INDIA" itemlabel="india"></apex:selectOption>
<apex:selectoption itemvalue="USA" itemlabel="usa"></apex:selectoption>
<Apex:selectoption itemvalue="UK" itemlabel="uk"></Apex:selectoption>
</apex:selectlist>
</apex:pageBlockSection>
</apex:dataTable>
</apex:pageblock>
</apex:form>
</apex:page>
there is lots of error is mistake in your class code
Please specify your requirement that what you want to do. and
mark your this answer as solved with select best answer ...and put a new question on fourm with specify requement so others experts look into it.
thanks