0

how to pass jquery variable from visual force component to apex controller?

The requirement is ,need to validate by checking the storage available in salesforce while uploading files ,

if the files are exceeded the limit need to show feedback message

here the script is in visualforce component

we used dropzone for file uploading

2
0

If your controller is using a @RemoteAction method, you can directly pass whatever params you want when calling that method.
If not, you can declare an apex:actionFunction with nested apex:param tag, which will become aliased as a JS function that you can simply call from your jQuery code. example:

<apex:actionFunction name="myValidator" action="{!yourControllerValidatorMethod}" rerender="">
    <apex:param name="param1" value="" assignTo="{!someControllerProperty}" />
</apex:actionFunction>

then in your javascript, you can easily call it like this: myValidator(yourJqueryVariable);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.