1

I would like to pass a parameter from my component to the controller. Here is the source code:

    <apex:actionFunction name="attachFil" action="{!attachFile}">
    <apex:param name="myImageURL" assignTo="{!pictureurl}" value=""/>
    </apex:actionFunction>

     <Script>attachFil('ok!!!');</script>

The controller have a field named pictureurl, and a function named attachFile. When I debug in the controller attachFile function, I find the pictureurl = null.

1

You need to add a rerender param to the actionFunction. This is a quirk of actionFunctions and has been around a while.

the rerender param can be anything - eg rerender="nothing" or rerender="" and it should work.

Also, make sure your variable that you are passing is public and has a setter, eg public String pictureurl {get; set;}

| improve this answer | |

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.