function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Andrew2XAndrew2X 

Possible bug: action method not invoked when rendered attribute specified for commandButton


I've struggled with this for a while, and searched the discussion boards and found nothing similar, so I've come to the conclusion that this must be a bug.

I have a commandButton that's part of a pageBlockButtons section:

<apex:commandButton action="{!saveAccountView}" value="Save View" rendered="{!AND(selectedViewId=null,NOT(selectedAccountId=null))}" />

That's the tag exactly as it appears on the page. The action method should navigate to a different page. Everything works fine if I remove the rendered attribute.  With the rendered attribute, the action method is never invoked, the page just refreshes. What's weird is that I have another commandButton on the page with pretty much the same rendered attribute and it works fine. I've tried changing the rendered attribute to:

 

<apex:commandButton action="{!saveAccountView}" value="Save View" rendered="{!showButon}" />

but that doens't work.


I've worked around this by using the style="visiblity:{!condition}", but I don't like this solution.


 

Big EarsBig Ears

Hello!

 

Did you ever get this fixed or discover a workaround?

 

With thanks,

Andy

Andrew2XAndrew2X

No... I used the workaround as indicated using style visiblity, and that's the way I left the markup.