+ Start a Discussion
benwrigleybenwrigley 

rerender commandButton only affects top button

Hi There,

 

I have a 'Save' button on my page that starts as disabled = 'true' until the form fields have been filled with valid information.

 

I have an apex:function that tests the validity of data and rerenders the save button.

 

All works fine, and when the data is valid the save button becomes active. But only the top one!

 

http://awesomescreenshot.com/0dc1o2y57

 

Anyone got a fix?

Best Answer chosen by Admin (Salesforce Developers) 
John De SantiagoJohn De Santiago

If you are using javascript then make sure you have the right name for both buttons. If you are calling a controller method to set the invalid property then try setting the rerender attribute on the apex function so that it rerenders the entire form which should reset the attributes on the save buttons both top and bottom.

 

Just my quick guess. Let me know if it works or more details on how you are disabling the buttons.

All Answers

John De SantiagoJohn De Santiago

If you are using javascript then make sure you have the right name for both buttons. If you are calling a controller method to set the invalid property then try setting the rerender attribute on the apex function so that it rerenders the entire form which should reset the attributes on the save buttons both top and bottom.

 

Just my quick guess. Let me know if it works or more details on how you are disabling the buttons.

This was selected as the best answer
benwrigleybenwrigley

Thanks rerendering the whole form works. Shame though as I only wanted to rerender a couple of elements.

 

Thanks!