9

When you specify the oncomplete attribute, VF is going to perform a Javascript AJAX postback rather than a full page post back to Salesforce. In the full page postback scenario, the entire page is rendered again, including your error messages. In the ajax postback, you've got to be explicit about which parts of the page you want rerendered when that action ...


8

The problem is you need to have an updated variable you can use in JS. To do this you need to refresh the block that has the js variable as the merge field is not automagically updated if the value changes in the controller. So rerendering a script block that defines the JS variable will get the most recent value. The following will show you that the alert ...


3

The following works in my testing: <apex:commandButton value="Reject (Entry Criteria)" onclick="if(!confirm('Are you sure?')){return false};" action="{!debugSomething}" oncomplete="refreshPage();" /> From the linked duplicate: onclick="return confirm('Are you sure?');" is always returning before calling the code to the controller method. What I ...


2

This code will work for you. Use notAllow attribute in the javascript function at oncomplete function itself. Visualforce <apex:page controller="myController2"> <apex:pageMessages id="showmsg"></apex:pageMessages> <apex:form> <apex:commandButton value="Save" action="{!save}" rerender="showmsg" oncomplete="javacript: if({...


1

The Pagerefence does not get the id of your object. See also the answer to this question: How to pass {!Case.ID} to PageReference pdf.getParameters().put('Id', listakta[b].id); Otherwise you will always get the same content. A small additional hint: do not loop over a counter, instead of for (integer b =0; b<listakta.size(); ++b){ you could iterate ...


1

With a normal button, you want to cancel the original operation: <button onclick="actfun(); return false;">...</button> This will prevent your whole-page-reload scenario.


1

Do one thing oncomplete of save button call a javascript function and check if notAllow false then open pop up <apex:pageMessages id="showmsg"></apex:pageMessages> <apex:commandButton value="Save" action="{!save}" rerender="showmsg,scriptPanel" oncomplete="openPage();" /> <apex:outputpanel id="scriptPanel"> <script> ...


1

Oncomplete attribute accepts a JavaScript function. You can use action function or JavaScript remoting if you want to call Apex function from JavaScript. Visualforce code: <apex:commandButton action="{!save}" id="saveButton" status="actStatusId" title="{!$Label.ahm__Save}" value="{!$Label.ahm__Save}" reRender="cREditPanel,...


1

Rerendering the <apex:pageBlock /> instead of <apex:datatable /> would solve the nested table issue.


1

Try using HTML table instead of apex:datatable.


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