19
votes
Accepted
Define APEX method with default arguments
In some use cases, you might want to consider fluent constructors on classes (or inner classes)
public class Foo {
Integer bar = 0; // default
String fie = 'Hello';
public static Foo ...
9
votes
Define APEX method with default arguments
Yes, you have to define method overloads. That is the only way to specify default argument values.
6
votes
Accepted
Passing Parameters Commandbutton
Need to be add a DummyID for reRedner.
<apex:page controller="clicktest">
<apex:form>
<apex:commandButton action="{!Stats_In}" value="click" reRender="dummyId">
<...
4
votes
Accepted
Using Param in ActionFunction - Unexpected Token ':'
You need to specify a name attribute, or you would get unexpected behavior.
<apex:param name="aValue" value="" assignTo="{!variableFromVfp}"></apex:param>
4
votes
Passing Id of object
The parameter you are sending is not called 'associateProject' but 'associatedProduct'.
You just have to do:
String project = ApexPages.currentPage().getParameters().get('associatedProduct');
2
votes
Accepted
Passing counter variable (apex:repeat + apex:var) into apex:assignTo yields 'null'
You have to rerender the form in commandButton
<apex:commandButton action="{!deleteNewChild}" rerender="yourform"
value="Remove">
<apex:param name="indexOfNewChildToRemove" ...
2
votes
Accepted
apex:Param not working with CommandButton component
Create a property in your controller, like
public propField {get;set;}
and assign it to the item.field__c like
item.field__c = propField;
Now, in your VF, set the property, like
AssignTo="{! ...
2
votes
apex:param not passing parameter to controller
Though optional you have to put in a name attribute for the apex:param.
Update:
A similar question was answered on why param needs a name attribute. Param gets passed as a key value pair to the ...
2
votes
param is not assigning values
apex:param is working perfectly, problem is with command button rerender
<apex:commandButton action="{!doSomething}" value="Click" rerender="none">
<apex:param name="param1" value="{!...
2
votes
Accepted
Passing Param to Apex Class for Delete from PageBlockTable
apex:param : A parameter for the parent component. The component can only be a child of the following components:
<apex:actionFunction>
<apex:actionSupport>
<apex:commandLink>
<...
2
votes
Passing Parameters Commandbutton
Just add a dummy panel and reRender it. It will work.
<apex:outputPanel id="panel2">
</apex:outputPanel>
<apex:commandButton action="{!Stats_In}" value="click" reRender="panel2">
...
1
vote
Error : Value provided is invalid for action parameter 'recordId' of type 'Id' in LWC imperative call to Apex
I have few queries on your use case.
Are you using your LWC component in a record context ?
If yes : Then the recordId is automatically set, the attribute should have @api
decorator. And your ...
1
vote
Accepted
CommandLink with action support visual force page
You can't pass the value to the controller; it's the attribute that shows the label. You can use the apex:param either directly or within the apex:actionSupport element. The only change you need to ...
1
vote
Accepted
Visualforce apex:param bound to non-existent controller property - no error?
This is not strictly a bug, at least not in Visualforce terms. Allow me to explain. Unlikely many other aspects of Salesforce, Visualforce is defined by its documentation. The documentation for ...
1
vote
Accepted
How do I code a 'confirm send' button on my VisualForce page?
You can do it in two way
Add your method to action and add onclick method
onClick="if(confirm('Are you sure you want to send the email?')){return true;}else{return false;}"
You can call action ...
1
vote
apex:param get just last element. How to fix that?
apex:commandButton does not support apex:param, and will have unexpected behavior. You would need to use one of the supported elements instead. Please read the documentation for apex:param. The ...
1
vote
Accepted
Visualforce page - Trying to delete record from a pageBlockTable using ActionSupport, but id is null?
apex:actionSupport is meant to be inside other elements, not outside; the click handler actually ends up bubbling up to include the entire table cell because of this. Also, since the param was on the ...
1
vote
Visualforce page - Trying to delete record from a pageBlockTable using ActionSupport, but id is null?
You need to add rerender attribute in commandLink. Also you don't need actionsupport here you can easily do using apex:commandLink.
<apex:commandLink rerender="none"
1
vote
Accepted
Apex param not passing the value in Selectlist
To pass param value in controller we must use rerender attribute. Use rerender attribute with your apex:actionSupport. It will solve your issue.
<apex:actionSupport event="onchange" action="{!...
1
vote
Passing counter variable (apex:repeat + apex:var) into apex:assignTo yields 'null'
Using apex:variable inside apex:repeat is an undefined operation. While it technically does work, there are known glitches with it. I would expect that you'd have problems with this. The problem ...
1
vote
Accepted
<apex:param/> tag seems to always assign the last value on visualforce page, regardless of which event was clicked
The docs state "adds AJAX support to another component"
<li id="li1" class="active">
<apex:outPutPanel layout="inline">
<a id="anchor1" href="#tab1" data-toggle="tab">
<...
1
vote
Passing Id of object
Try adding the assignTo attribute on your <apex:param>. This will allow you to assign the value you're trying to access to a variable in your controller.
In Visualforce:
<apex:...
1
vote
Accepted
Null apex:param when value is from map
I'm sorry to say that you can't pass an object as a parameter. Salesforce says:
The value attribute must be set to a string, number, or boolean value.
So you'll have to extract the value you want ...
1
vote
Accepted
delete row when click on hyperlink of delete
There are couple of things which are not handled correctly.
Your actionFunction should have reRender attribute. You have used reRendered.
Create List<Stud__c> using getter instead of defining ...
1
vote
delete row when click on hyperlink of delete
Try changing this piece of code
<apex:pageblockTable value="{!contacts}" var="co">
<apex:column headerValue="Delete Record">
<a href="#" onClick="remove('{!co....
1
vote
How to implement <apex:param> using dynamic visualforce components
As per this document: Dynamic Components Supported Attributes
<apex:param> and few more attributes are not valid in dynamic components creation.
The following standard Visualforce ...
1
vote
Accepted
String coming through as null after apex:param
If CXT_Opportunity_Name__c is a Lookup to another object, you're passing the object value to a String which wouldn't work.
What you'd need to do is assign the value to an instance of that object, ...
1
vote
String coming through as null after apex:param
You are missing rerender here. Add rerender in your actionsupport and also add in value in param
<apex:actionSupport event="onchange" action="{!checkIfSelectedContactHasPendingOpp}" rerender="none"...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
apex-param × 65visualforce × 43
apex × 29
controller × 9
actionfunction × 9
javascript × 6
commandbutton × 6
parameters × 6
repeat × 5
actionsupport × 5
list × 3
commandlink × 3
dynamic-visualforce × 2
rerender × 2
pageblocktable × 2
table × 2
outputtext × 2
lightning-aura-components × 1
lightning-web-components × 1
soql × 1
unit-test × 1
salesforce1-app × 1
code-coverage × 1
visualforce-component × 1
aura × 1