[SalesForce] reRender not working on visualforce page

Here is the apex component

 <apex:pageBlock id="tableId2">
                <apex:pageBlockTable value="{!lstResultWrapper}" var="items" id="table">

                    <apex:column headerValue="Deal Title"> 
                    <apex:outputText value="{!items['opportunity'].Name}"/> 
                    </apex:column> 

                    <apex:column headerValue="Deal Value"> 
                    <apex:outputText value="{!items['opportunity'].Amount}"/> 
                    </apex:column> 

                    <apex:column headerValue="Stage"> 
                    <apex:outputText value="{!items['opportunity'].StageName}"/> 
                    </apex:column> 

                    <apex:column headerValue="Industry"> 
                    <apex:outputText value="{!items['account'].Industry}"/> 
                    </apex:column> 

                    <apex:column headerValue="Country"> 
                    <apex:outputText value="{!items['account'].BillingCountry}"/> 
                    </apex:column> 

                    <apex:column headerValue="City"> 
                    <apex:outputText value="{!items['account'].BillingCity}"/> 
                    </apex:column> 

                    <apex:column headerValue="Action"> 
                        <apex:commandButton value="Find Clozer" action="{!createDeal}" reRender="tableId2" rendered="{!items['isCreated']}"> 
                             <apex:param name="title" value="{!items['opportunity'].Name}" assignTo="{!title}" />
                             <apex:param name="dealValue" value="{!items['opportunity'].Amount}" assignTo="{!dealValue}" />
                             <apex:param name="stageName" value="{!items['opportunity'].StageName}" assignTo="{!stageName}" />
                             <apex:param name="ind" value="{!items['account'].Industry}" assignTo="{!ind}" />
                             <apex:param name="count" value="{!items['account'].BillingCountry}" assignTo="{!count}" />
                             <apex:param name="cty" value="{!items['account'].BillingCity}" assignTo="{!cty}" />
                        </apex:commandButton>
                    </apex:column> 

                </apex:pageBlockTable>   

Here

  1. reRander is use for refresh the table when this button is pressed
  2. randered is use for if the button is press before then make the button invisible.

But the button is press for the first time the table isnt refreshing…
There is the problem ?
Thanks in advance

Note : createDeal is a void method.So its returning nothing

Best Answer

As per the functionality you are trying to achieve, I would suggest you to use apex:actionFuntion.

You can call/invoke the apex:actionFunction from button actions (Ex: onclick, oncomplete) as per your requirement.Please see the below link for more details on actionFunction.

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_actionFunction.htm

apex:commandbutton supports many actions. Please see the below link for more details on commandbutton. https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_commandButton.htm

Related Topic