The Stack Overflow podcast is back! Listen to an interview with our new CEO.
27

When a re-render occurs, only the portion of the DOM that is set to rerender is actually re-rendered. Therefore, any jQuery event bindings that you created on $(document).ready() are essentially lost for the portion of the DOM that was re-rendered. If you wrap these event binding calls in a function, it's easy to re-bind. What I do in these scenarios is use ...


10

Your apex:outputPanel with id="Travel_block" is not rendered by default, because the selectedAPTransport variable is not Yes. If it is not rendered, then it is not accessible by ID for actionSupport. You need to wrap this pannel with another panel without layout and rerender it (wrapperPannel in my example): <apex:selectRadio value="{!selectedAPTransport}...


10

The order of operations with an ajax request is: onClick/onSubmit functions are called ajax form POST to controller (wait patiently while controller does work) response received from Salesforce onBeforeDomUpdate is called DOM is updated (using the collection of rerender element names) onComplete is called page is ready for the user again I can't find any ...


9

{!} is merge syntax Adding parentheses may help visualize what is happening in your evaluations. true and not true == false <apex:outputLink rendered="{! (isTrue && !isTrue) }"> true and not not true (true to false and then back to true) == true <apex:outputLink rendered="{! (isTrue && !!isTrue) }">


9

As per @TrevorBliss comments , adding afterScriptsLoaded to the ltng:require is sufficient which means there's no need for the renderer. If you really need to do this in the renderer, then you need to do below: Use rerender instead of afterRender. Have a flag to indicate the script has been loaded and set it's value to true in afterScriptsLoaded method of ...


8

You've fallen into a tricky gotcha with re-rendering. When the re-render is processed, only the children of the re-rendered component or re-processed. Hence the your {!opportunity.stageName === 'Lead Qualified'} statement isn't re-evaluated and the section isn't shown. The solution is to re-render the parent of the section having the conditional changed. ...


8

Through attempting this same problem on another project I was able to get a fresh look at the issue. What I learned through countless testing is that rerender attribute can be very tricky. For example: As many already know, if you do not provided the rerender attribute in your actionFunction then your parameters will not be sent. Rerender cannot be a ...


7

Rerendering is not supported when you have an apex:inputFile component. There's no workaround, as the platform simply will not allow it. The best you can do is to move the apex:inputFile into an apex:iframe which will leave the rest of the "page" alone. BTW If you are looking to rerender the entire page, that sounds the same as a refresh.


7

Putting an <apex:outputPanel> inside your <apex:pageBlockButtons> tags and using that as the rerender target makes the page work as expected: <apex:selectList value="{!selectId}" size="1"> <apex:selectOptions value="{!display}"></apex:selectOptions> <apex:actionSupport event="onchange" action="{!...


7

Please change <aura:attribute name="expenses" type="Sledgehammer.Expense__c" /> to <aura:attribute name="expenses" type="Sledgehammer.Expense__c[]" /> in your "form.cmp"


7

Analysis Conclusion You do not need to return a PageReference for rerender to understand when the action has completed. So if you have a method that will never cause a redirect, you can make it void after all. Still looking for documentation one way or the other. At the bottom I have included my code used to support this conclusion. All four buttons in the ...


6

Visualforce has two types of elements: managed and unmanaged. Managed elements can be referenced through $Component, while unmanaged elements cannot. You can tell if an element is managed because it will have a namespace, such as c or apex. For example, <apex:outputPanel> is managed, <select> is not. Visualforce cannot re-render any element that ...


6

If you want to call the JavaScript after the re-render use the oncomplete attribute of apex:actionPoller to make the function call: The JavaScript invoked when the result of an AJAX update request completes on the client.


6

The apex:outputPanel is messing up your output, as it causes all of its children to be rendered in the same column (it's intended to group together elements inside an apex:panelGrid). <apex:pageBlockSection title="Variables" id="Variables" columns="1"> <apex:pageblockSectionItem > <apex:...


5

Here's an option that still keeps your pageBlockTable. Add your jquery resource or link to it. Then, add this to head... <apex:includeScript value="{!URLFOR($Resource.jQuery, '/js/jquery-1.4.2.min.js')}" /> <script type="text/javascript"> $j = jQuery.noConflict(); function clickElem(elem){ alert($j(elem).find(".accId").html()); ...


5

apex:actionFunction has an oncomplete attribute where you can specify JavaScript to run once the partial page update has completed. So you will need to move your DataTables setup code into a function that can be called from there as well as the page ready event so the DataTables JavaScript is run after the Ajax update. (Personally I try to avoid putting ...


5

Pretty sure it is related to this issue/bug re Command Buttons and Action Regions. I just tried a short version of your code with the button wrapped in an actionregion, and it then worked for me.


5

Catch the enter-key at your inputText with the onkeypress-handler and trigger a fake-click on the button: <script> function handlerKeyPress(ev) { if (window.event && window.event.keyCode == 13 || ev.which == 13) { $('.myUniqueSubmitButtonClass').click(); return false; } else { return ...


5

If you have defined some value for the reRender parameter of the command button it will be recognized as an element ID and this element will be refreshed. So it is not important what value is used, but is should be an ID of some element that exists on the page. If there is no elememt with such ID, then nothig will be rerendered. Another important thing is ...


5

You can't depend on the order of setters or getters. You should avoid doing this at all cost. In fact, you can't even guarantee that your setters or getters will be called only once per transaction, so your "two queries" might very well become four or six (or more!), depending on page structure. If you must use this design, then opt for "lazy initialization"...


5

Its a known bug in SFDC Visualforce page .I have used a jquery approach with action function to manually write the DOM .You can use Oncomplete event and custom write the DOM to replace The Script would look like below <script> var j$ = jQuery.noConflict(); function renderSVG(){ var imageURL = '{!URLFOR($Resource....


5

There are 2 issues in your code. event "onchange" is case sensitive (all will be in lower case). So, DO NOT use "onChange" If you are using actionSupport for rendering then <apex:inputText required="true"/> will create an issue in rendering Wrong code <apex:inputText value="{!opportunityAmount}" required="true" styleClass="requiredInput" /> ...


5

You need to change the code like this way Firstly, Remove immediate=true from apex:selectRadio which stops assigning controller attribute properly. Secondly, Wrap those outputPanels (which are conditional) within a separate panel like here myPanel and try to render this myPanel from actionSupport rerender attribute. Thirdly, instead of using rendered="{!...


5

Polling every 5 seconds is bad imo and waste of resources. Polling generally slows things down as well. From what I can see if all you want is a notification for newly created, deleted case. Once you get the notification you can do a query and get the latest data. And, the best candidate here is Streaming API, Just Implement the VF client for streaming ...


4

SOLUTION FOUND!!! The suggestion by Mohith Kumar to use actionFunction was the correct way to go. It just took a little research and better understanding of how actionFunction works to implement the solution. After some googling, I finally found a blog post (http://shivasoft.in/blog/salesforce/passing-parameter-in-actionfunction-in-visualforce/) that really ...


4

I would've expected it to rerender. The Order of Execution for Visualforce Page Postback Requests would lead me to believe that the component's controller set methods should be called and the view state should be updated. This seems similar to the recently asked question on apex:details not rerendering. You could reRender the component on the onComplete ...


4

I'm surprised this doesn't work but then I can't remember if I've ever tried it. Given the global nature of javascript variables and elements used in components you could put an <apex:outputPanel> inside your component wrapping everything else, and give it a particular ID. Then specify that ID in the rerender attribute of the <apex:actionFunction&...


4

What you need is a Wrapper for each data row you want to display. the wrapper will take care of the SelectOptions. Below is an example, that displays a list of Opportunities for which you can select a Contact based on the Opportunity's AccountId To avoid to run into Governor Limits #getItems() is responsible for setting up the selectOptions in bulk ...


4

Visualforce generates unique DOM ids and, in your case, a different one for each row in the repeat. The ActionFunction (outside the repeat) does not know which row id to rerender. Try using an apex:ActionSupport from within the apex:inputCheckbox. Called from here (within the loop), rerender will work correctly.


4

The code fragment in your next() action method Pagereference newaccount1 = new Pagereference('/001/e?nooverride=1&acc2='+aname+'&acc18street='+ashippingstreet+'&acc18city='+acity+'&acc18state='+astate+'&acc18zip='+azip+''); return newaccount1; is missing the redirect Pagereference newaccount1 = new Pagereference('/001/e?nooverride=1&...


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