function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Neil KimNeil Kim 

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
<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!
Neil KimNeil Kim
@Ahmed, Of course, I have variables in Controller, and I'm familiar with using Actionfunction.

What I'm wondering is that even variable sent to controller normally, but page doesn't move to PageReference value page.