+ Start a Discussion
nani@rnani@r 

how to set a new button in visual force page?

dis is my code but i can't set new button 

 

<apex:pageBlockButtons >
<apex:commandButton action="{!naNew}" value="New"/>
</apex:pageBlockButtons>

 

 


public pagereference naNew(){
// book__c b = new book__c();
pagereference sp = new pagereference('/apex/newpage');
return sp;
}

Suresh RaghuramSuresh Raghuram

what do u mean by set for the button can u share more information

nani@rnani@r

i want a new button for entering record in datamodel 

Shiva Ramesh @ xcdhrShiva Ramesh @ xcdhr

VF page

 

<apex:page standardController="Account" extensions="newvsold" action="{!pageredir}">

</apex:page>
Apex class would be...
public class newvsold
{

public newvsold(ApexPages.StandardController controller)
{

}
public Pagereference pageredir()
{
Pagereference newpage = new Pagereference ('/001/e?retURL=/001/');
return newpage;
}
}