I'm trying to rendered a commandLink base on a variable inside the controller.
When I use the rendred like below, its everytime get "false" value, and I cant see it (rendered=false)
My variable's name inside the controller is : "showProdTables".
<apex:commandLink id="addtotableId" action="{!addToTable}" value="{!srt}" oncomplete="doneAdding();" rendered="{!showProdTables}" />
but If I use the same variable in the value attribute like below and remove the rendered attribute:
<apex:commandLink id="addtotableId" action="{!addToTable}" value="{!showProdTables}" oncomplete="doneAdding();" />
I can see it turn to true when it needs to be and false otherwise.
I making an actionsupport to call the controller - and I Rerender the commanLink's Id there :
<apex:selectList value="{!productItemSelected}" id="selectedProductItemListId">
<apex:selectOptions value="{!prdt222}" id="selectOptionsProductItemId"/>
<apex:actionSupport action="{!checkProductPrice}" event="onchange" reRender="quantity,pricing,comments,addtotableId" />
</apex:selectList>
What am I missing here?
BTW - I rendered other sections with this variable ("showProdTables") and it working fine. I tried to wrap it with outputPanel but it's not working either.
UPDATE BASED ON SFDCFOX ANSWER
Something that helped me : (although I don't like solution of this kind) I wrapped it with double output panels one is the Id and one is the rendered one.
<apex:outputPanel id="addtotableId">
<apex:outputPanel rendered="{!showProdTables}" >
<apex:commandLink action="{!addToTable}" value="customLabel" reRender="addtotableId" oncomplete="doneAdding();" />
</apex:outputPanel>
</apex:outputPanel>