+ Start a Discussion
gregusagregusa 

Multiple Apex:commandLinks in apex:pageBlockTable doesn't work.

I need to be able to have two buttons in the footer of a pageBlockTable, one to add a row, one to remove a row.  The functionality behind the buttons works great if I have one or the other buttons in the VisualForce page at a time.  If I try the following, the last button is the only button that is rendered:

Code:
       <apex:pageBlockTable value="{!over}" var="a" id="table"> 
<apex:facet name="footer"> <apex:commandLink value="Add Row" action="{!addRow}" rerender="table,error"/> <apex:commandLink id="RemoveRow" value="Remove Row" action="{!removeRow}" rerender="table,error" immediate="true" /> </apex:facet>

Shouldn't both buttons render given the above code>

Best Answer chosen by Admin (Salesforce Developers) 
gregusagregusa
That's it.  Thanks!

Greg

All Answers

JimRaeJimRae
Try putting them in a pagebutton block:

Code:
 <apex:pageBlock >
<apex:pageblockButtons location="bottom">
<apex:commandLink value="Add Row" action="{!addRow}" rerender="table,error"/>
&nbsp;
<apex:commandLink id="RemoveRow" value="Remove Row" action="{!removeRow}" rerender="table,error" immediate="true" />
</apex:pageblockButtons>
<apex:pageBlockTable value="{!over}" var="a" id="table">

 

gregusagregusa
That's it.  Thanks!

Greg
This was selected as the best answer