You need to sign in to do that
Don't have an account?
Problem with reRender and setRedirect
Hi everyone.
I have some issue. Please help me.
I'm confused about reRender and setRedirect.
I saw several another post, but cannot understand their resolution.
First of all, here is code below
VF
Problem is
with rerender + setRedirect(false) = first click no response, second click show error(session invalid)
with rerender + setRedirect(True) = page move normally, variable empty. - Controller reloaded?
without rerender + setRedirect(false) = page move normally, variable empty. - actionfunction cannot catch params?
without rerender + setRedirect(True) = page move normally, variable empty. - actionfunction cannot catch params?
So, how can I get normal page moving + preserve variables?
Please help!
I have some issue. Please help me.
I'm confused about reRender and setRedirect.
I saw several another post, but cannot understand their resolution.
First of all, here is code below
VF
<apex:form id="myform"> <apex:actionFunction name="moveTo1" action="{!moveTo1}" reRender="myform" status="myStatus"> // reRender is first issue <apex:param name="firstparam" assignTo="{!currentC}" value=""/> <apex:param name="secondparam" assignTo="{!currentD}" value=""/> <apex:param name="thirdparam" assignTo="{!currentT}" value=""/> </apex:actionFunction> <script> function move(){ moveTo1(document.getElementById('aaa').value, document.getElementById('bbb').value, document.getElementById('ccc').value); } </script> </apex:form>Controller
public PageReference moveTo1(){ PageReference pg; pg = Page.VFpage1; pg.setRedirect(false); // Here is another Problem, return pg; }
Problem is
with rerender + setRedirect(false) = first click no response, second click show error(session invalid)
with rerender + setRedirect(True) = page move normally, variable empty. - Controller reloaded?
without rerender + setRedirect(false) = page move normally, variable empty. - actionfunction cannot catch params?
without rerender + setRedirect(True) = page move normally, variable empty. - actionfunction cannot catch params?
So, how can I get normal page moving + preserve variables?
Please help!
i think it will help you go to below link
https://www.jitendrazaa.com/blog/salesforce/passing-parameter-in-actionfunction-in-visualforce/
What I'm wondering is that even variable sent to controller normally, but page doesn't move to PageReference value page.