20

You can access the param that was passed directly inside you controller using the ApexPages class or the system class. VF <apex:outputLink value="javascript:if (window.confirm('Are you sure?')) DeleteQuoteLineItem('TEST VALUE');"> Del </apex:outputLink> <apex:actionFunction action="{!DeleteQuoteLineItem}" name="DeleteQuoteLineItem" ...


16

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 newInstance() {return new Foo();} public Foo withBar(Integer val) {this.bar = val; return this;} public Foo withFie(String val) {this.fie= val; return this;} ...


11

You can accomplish this by using the format below <apex:outputText value="{0,date,MMMM dd, yyyy}"> <apex:param value="{!TODAY()}" /> </apex:outputText> Here is the supporting documentation for formatting dates with output text http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_outputText.htm And here is some ...


9

If you want to pass data which does not require scope within the whole controller class, but rather requires to be visible only in the scope of called controller method, maybe you could consider using apex js remoting? E.g. your example with the js remoting approach might look like: VF page: <apex:outputLink value="javascript:if (window.confirm('Are you ...


8

You can retrieve parameters passed in the URL directly: ApexPages.CurrentPage().getParameters().get('d')


8

Yes, you have to define method overloads. That is the only way to specify default argument values.


5

Found out what the problem was and thought I'd post it here in case anyone else has the same issue. Because the start and end were objects (moment), they weren't casting properly to the controller properties. My solution was: Javascript: select: function(start, end, jsEvent, view) { setStartEndDatesAF(start.format('YYYY-MM-DD HH:mm:ss'), end.format('...


4

Even though you only have 1 SOQL statement in your code it gets executed 3 times, once for every call to Count(). If you use a map where the key is the status and the value is the count you can do something like the code below. This code will only execute the SOQL once. Ordered Items: <apex:commandButton value="{!statusCount['Ordered']}"/> ...


4

JavaScript is client side, while apex code renders server side. In other words, Salesforce tries to convert the literal value of "today" into a date using valueOf, which fails, because it's not a valid formatted date. You have a few choices here, depending on the exact usage you're going for. Perhaps the easiest would be to store the value in a hidden field:...


4

The actionSupport tag is to enable AJAX support on the page and hence only works for AJAX requests. In order to get it working, all you need to do is put the "Selected:" portion in an outputPanel and add reRender to the actionSupport tag. See example code below that works: <apex:page controller="ActionSupportParamDemoController"> <apex:form > ...


4

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 based on the param value string: public void doSomething() { String ParamValue = Apexpages.currentPage().getParameters().get('indexValue'); index = ...


4

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) this.evt = new Event(); return this.evt; set; } ... elsewhere in your controller (like in the custom save action method, you can use this.evt....


4

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.debug(paramValue); return null; } and the page <apex:actionfunction name="attach_file" action="{!AttachFile}" reRender=""&...


4

The parameter you are sending is not called 'associateProject' but 'associatedProduct'. You just have to do: String project = ApexPages.currentPage().getParameters().get('associatedProduct');


4

Need to be add a DummyID for reRedner. <apex:page controller="clicktest"> <apex:form> <apex:commandButton action="{!Stats_In}" value="click" reRender="dummyId"> <apex:param name="MS_Item" value="MS_Item_45382" assignTo="{!MS_Item}" /> </apex:commandButton> </apex:form> </apex:page>


4

You need to specify a name attribute, or you would get unexpected behavior. <apex:param name="aValue" value="" assignTo="{!variableFromVfp}"></apex:param>


3

The problem with your code is that the apex:param is outside of the apex:actionFunction. Other code looks ok, but it is uclear what changes you have made on it. So i will post here a working example of passing parameter. Try to modify your code based on this template: Controller: public with sharing class MyController { public String passedParam { get; ...


3

use actionfucntion like below because in your code param is outside from the action function which is not the right way. Please give it a try and let us know. <apex:actionFunction name="doActualDeleteAttachment" action="{!deleteAttachment}" rerender="output_table"> <apex:param name="attachmentToDeleteParam" value="" assignTo="{!...


3

Try changing it to this by adding a name attribute to the Apex:param <apex:param value="{!relation.Id}" assignTo="{!selectedDetailID}" name="dtlIdParam"/> Source: <apex:param> assignTo attribute not setting value to contoller variable


2

Not sure why it doesn't update the parameter, but could you perhaps use a different ID in the URL when loading the page? <apex:detail subject="{!IF($CurrentPage.parameters.cid != null, $CurrentPage.parameters.cid, $CurrentPage.parameters.contactId)}" relatedList="false" title="false" /> So you'd use contactId when calling the page from elsewhere and ...


2

The controller parameter of your constructor can return a reference to the record bound to the page using controller.getRecord(). You can then check this value directly. You don't need to use an apex:param attribute. Edit Change your controller to this: public with sharing class GDT_Activity_Controller { public Boolean S01 {get; set;} ...


2

The wrapper approach - the normal solution to providing derived values in a table row - would be to return a list of this inner class: public class Wrapper { private MyController c; public Relationship_Detail__c sob {get; private set;} Wrapper(MyController c, Relationship_Detail__c sob) { this.c = c; this.sob = sob; } ...


2

So I have to do a workaround for this. I am still keeping my rerender since it returns the params I need, but I am now redirecting the page using javascript. <apex:actionFunction name="save" action="{!saveRecord}" rerender="" oncomplete="redirect('{obj.Id}');"> <apex:param name="somevar1" value=""/> <apex:param name="somevar2" value="...


2

You can define your own CSS class that will make all TH's in a certain table bold: #pageblockTable th { font-weight: bold !important; } This CSS applies to all TH elements that are children of the elemen with ID pageblockTable.


2

As Pramod says, this is a known issue, the alternative workaround is to add reRender=... to your commandButton <apex:commandButton action="{!getRichiestaDetail}" image="{!$Resource.detail_icon}" id="getRichiestaDetail" rerender="somecomponent" style="border:none;background:none;padding:0px;vertical-align:top;"> ...


2

Try to change Salesforce API version of the page and controller to 30.0 instead of 31.0. I ran into the same issue recently and this helped me. Let me know if it works for you.


2

In your commandlink tag, you need to use rerender tag to implement AJAX so that your page will not be refreshed. You can check visualforce component reference to see how rerender can be used with apex:commandlink tag.


2

Instead you can use the IF condition in the value attribute of the outputText <apex:outputText value="{!IF(activeUser.Name == like.user.Name, 'You', like.user.Name)}" />


2

you can try something like <apex:variable var="input" value="" /> <apex:inputText value="{!input}" styleclass="textCls"/> <apex:commandButton value="Search" onclick="passValue()" rerender="none"/> <apex:actionfunction action="{!doSearch}" immediate="true" /> <apex:param name="value" assignTo="{!...


2

<apex:actionFunction name="doSave" action="{!save}" rerender="none"> <apex:param name="param" assignTo="{!myControllerBoolean}" value=""/> </apex:actionFunction> <apex:commandButton value="Save" onclick="confirmThis();" rerender="none"/> Use rerender attribute with commandbutton and actionfunction.


Only top voted, non community-wiki answers of a minimum length are eligible