+ Start a Discussion
MrithulaMrithula 

how can i delete the values in the field ?

hi,

 

i don't have idea to delete the values in the fields in the following scenario....

 

1) i have 3 text boxes(inputtextfields) that accepts values from the user

 

2) the values will be submitted if SAVE button is clicked

 

The values are saved but the textboxes are not cleared automatically.

 

iam using clear button to clear the values.

 

but i need  to clear my textboxes AUTOMATICALLY  when i click the save button.

 

 

 

SabrentSabrent

Did you try    setRedirect(true) ?

 

After you insert the record do this,

 

    PageReference pageRef = new PageReference('/apex/visualforce_page_name..);
    pageRef.setRedirect(true);
   return pageRef;

 

After the save , this will bring the user to same page and will clear the fields that have been previously filled in.

 

Hope this helps.

 

MrithulaMrithula

hi,

 

my code in VF page is as follows:

 

<apex:pageBlockButtons location="bottom">
<apex:commandButton value="SAVE" action="{!save}"/>
<apex:commandButton value="CANCEL" action="{!cancel}"/>

</apex:pageBlockButtons>

 

i didn't write the separate code for save action in the apex class..

is it possible to write the  setRedirect(true) inside the code..??

 

 

SabrentSabrent
In you class do this

public PageReference save(){
PageReference pageRef = new PageReference('/apex/visualforce_page_name..);
pageRef.setRedirect(true);
return pageRef;

}