18
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 ...
8
votes
Define APEX method with default arguments
Yes, you have to define method overloads. That is the only way to specify default argument values.
5
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
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');
4
votes
Accepted
Pass value from the visualforce page to a global variable of a class
A good solution to this is to use a proxy object in the controller to capture the dateTime value
public Event evt { // proxy object, fld StartDateTime is creatable
get {
if (this.evt == null)
...
4
votes
Accepted
Apex:param not sending parameter in actionFunction
I have had mixed luck doing it like that (probably my own fault). However I know this works (string values):
public string paramValue {get;set;}
public pagereference AttachFile(){
system....
4
votes
Accepted
Can apex:param pass null for Integers?
It looks like the problem is that when the parameter comes over as an empty string, salesforce converts the value to 0 instead of NULL. You could consider setting the value of index in your method ...
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>
2
votes
Accepted
Define apex:variable in apex:inputText
you can try something like
<apex:variable var="input" value="" />
<apex:inputText value="{!input}" styleclass="textCls"/>
<apex:commandButton value="Search" onclick="...
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">
...
2
votes
Accepted
How to pass js confirm response to an action function
<apex:actionFunction name="doSave" action="{!save}" rerender="none">
<apex:param name="param" assignTo="{!myControllerBoolean}" value=""/>
</apex:actionFunction>
<apex:...
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"...
1
vote
Vf page error when try to delete row on vf page
The core issue is that you need to use <apex:commandLink> here, not <apex:commandButton>. From the documentation for the <apex:param> tag:
The <apex:param> component can only ...
1
vote
Accepted
not getting actionfunction parameters on controller method
You will have to reRender the elements on the page to set the values at backend
I would designate an Id with an outputPanel and reRender
<apex:page controller="SendAgreementExt" id="thePage">
...
1
vote
apex:repeat with Save button, saves only first record in it
You need to change your repeat to use updatMembersList:
<apex:repeat value="{!updatMembersList}" var="child">
You don't really need two separate List<Member> properties, though. The ...
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