function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AkashGarg555AkashGarg555 

How to pass parametrized method in Visual force

Hi,
I have a requirement where I have to put a ID in "inputtext" and after clicking on button, i have to show the result in table .
I am very badly stuck in this.
Controller : -
public with sharing class HealthCheckRestCallsUtility {

    @RemoteAction
    public static List<Request360Controller.MultipleRequestDetail> fetchRequestsStatus(String requestIds) {
        

        return  Request360Controller.getRequestDetails(requestIds);

    }
}
 
VF Page : - 

<apex:page controller="HealthCheckRestCallsUtility">
    <script>
     function passingValue(){
         var primeProductId=document.getElementById("j_id0:j_id2:j_id3:txt1").value;
         send(primeProductId);
    }
    </script>
    <apex:form >
        <apex:pageBlock title="Check Request Status">
            <apex:inputText value="{!inputTxt1}" id="txt1" />
            <br/>
            <apex:commandButton value="Check Status" onclick="passingValue()">
                <apex:param name="primeProductId" AssignTo="{!primeProductId}" />
            </apex:commandButton> 
            <apex:actionFunction name="send" action="{!fetchRequestsStatus()}">
                <apex:param name="primeProductId" AssignTo="{!primeProductId}" />
        	</apex:actionFunction> 
        </apex:pageBlock>   
    </apex:form>
</apex:page