Activity Forums Salesforce® Discussions In Salesforce, How to call parametrized function from Visualforce?

  • Gourav

    Member
    October 3, 2016 at 2:12 pm

    Hi Tanu,

    The <apex:param> standard component allows parameters to be defined for a parent component, which can be assigned to a controller property.

    VF Page:-

    <apex:commandButton value="Del" action="{!delCont}" rerender="all">
    <apex:param name="contIdParam" value="{!cont.id}" assignTo="{!contIdChosen}"/>
    </apex:commandButton>

    Controller:-

    public String contIdChosen {get; set;}

    ...

    ...

    public PageReference delCont()
    {
    Contact toDel=new Contact(id=contIdChosen);
    delete todel;
    setupContacts();
    return null;
    }

    Hope this will help you.

    Thanks.

     

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos