reRender outputPanel from javascript function in visualforce

I want to reRender “TopPanel” from javascript, is there any way to do this in visualforce ?

<apex:outputPanel id="TopPanel">
<apex:outputPanel>

<script type="text/javascript">
function CreateTabs()
{
    //rerenderCode for TopPanel
}
</script>

Answer

This is what an actionFunction is for

<apex:actionFunction name="rerenderTopPanel" rerender="TopPanel" />
<apex:outputPanel id="TopPanel">
</apex:outputPanel>

<script type="text/javascript">
    function createTabs() {
        rerenderTopPanel();
    }
</script>

Attribution
Source : Link , Question Author : Prafulla Patil , Answer Author : metadaddy

Leave a Comment