Activity Forums Salesforce® Discussions How can I call PageBlockSection at CommandLink Action in Salesforce?

  • Manpreet

    Member
    January 18, 2018 at 4:56 am

    Hi Saloni,

    I just moved it out as separate function and calling it from commandbutton. you can do the same with commandlink as well.

    <apex:page >
    <script>
    function expandCollapse(){
    twistSection(document.getElementById('{!$Component.theForm.block1.section1}').getElementsByTagName('img')[0]);
    }
    </script>
    <apex:form id="theForm">
    <apex:commandButton value="Click Me" onclick="expandCollapse(); return false;"/>
    <apex:pageBlock id="block1">
    <apex:pageBlockSection id="section1" columns="2" collapsible="true" title="Title">
    Example Area
    </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:form>
    </apex:page>

    Thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos