+ Start a Discussion
pradyprady 

Rerender not working with command button

<apex:commandButton action="{!save}" reRender="tableApp"  value="Save"/>

 I have a save button in Vf page and when the reRender tag is given the button doesnt seem to work. It would nt perform the save operation. When i remove the reRender tag it works fine.

 

I want a pageblock to be rerendered after the record is saved.

 

Any ideas?

kiranmutturukiranmutturu

for standard actions u can't rerender the components... go for custom action and save it in the controller.. then it will works for u 

pradyprady

I am not sure if i understood what you said.

 

I do have the save method in the controller and in the action i am calling the method called save in the controller.

Chamil MadusankaChamil Madusanka

Hi,

 

Try this,

 

<apex:commandLink action="{!save}"> 
<apex:commandButton  value="Save"/>
</apex:commandLink>

 If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

Kevin SwiggumKevin Swiggum

Is the pageBlock you're trying to re-render the same page block that holds the Save commandButton? If that's the case, you might want to try re-defining the area to re-rerender by putting an <apex:outputPanel id="tableApp"> around the pageBlockSections that you want to re-render...and keep the commandButton outside that outputPanel section. 

 

It might also help to check your browser's javascript console to see if you're getting any errors.

pradyprady

No, its not the block where we have the save button, i am rerendering a different block .

Kevin SwiggumKevin Swiggum

hmm. Does your save() method return null? Or is it returning something else? I've seen other posts where returning null works rather than returning the current page reference.

pradyprady

Kevin,

 

Save method returns null.