Skip to main content
Tweeted twitter.com/#!/StackSalesforce/status/635492916694261761
added 1 character in body
Source Link
wesaw
  • 3.2k
  • 1
  • 21
  • 50

To model the situation, let's say that I have two visual force pages, which use the same controller. Let's call them PageStart and PageEnd. PageStart uses action attribute for apex:page element. Inside this action some properties are set and then PageEnd reference is returned. But when I try to display values of these properties right on PageEnd, I've got NullPointer exception, i.e. values are lost when moving from PageStart to PageEnd. It looks like new controller instance is created for PageEnd.

So, my question is: what kind of redirect happens when we return some page from apex:page action attribute's method ? Is it always external redirect even if I'm returning another page which uses exact the same controller ? Can I somehow force it to be internal redirect and keep state (set redirect to truefalse on page ref doesn't help).

Any suggestions would be appreciated, and thanks in advance for you help guys.

To model the situation, let's say that I have two visual force pages, which use the same controller. Let's call them PageStart and PageEnd. PageStart uses action attribute for apex:page element. Inside this action some properties are set and then PageEnd reference is returned. But when I try to display values of these properties right on PageEnd, I've got NullPointer exception, i.e. values are lost when moving from PageStart to PageEnd. It looks like new controller instance is created for PageEnd.

So, my question is: what kind of redirect happens when we return some page from apex:page action attribute's method ? Is it always external redirect even if I'm returning another page which uses exact the same controller ? Can I somehow force it to be internal redirect and keep state (set redirect to true on page ref doesn't help).

Any suggestions would be appreciated, and thanks in advance for you help guys.

To model the situation, let's say that I have two visual force pages, which use the same controller. Let's call them PageStart and PageEnd. PageStart uses action attribute for apex:page element. Inside this action some properties are set and then PageEnd reference is returned. But when I try to display values of these properties right on PageEnd, I've got NullPointer exception, i.e. values are lost when moving from PageStart to PageEnd. It looks like new controller instance is created for PageEnd.

So, my question is: what kind of redirect happens when we return some page from apex:page action attribute's method ? Is it always external redirect even if I'm returning another page which uses exact the same controller ? Can I somehow force it to be internal redirect and keep state (set redirect to false on page ref doesn't help).

Any suggestions would be appreciated, and thanks in advance for you help guys.

Source Link
wesaw
  • 3.2k
  • 1
  • 21
  • 50

Redirect in page action attribute

To model the situation, let's say that I have two visual force pages, which use the same controller. Let's call them PageStart and PageEnd. PageStart uses action attribute for apex:page element. Inside this action some properties are set and then PageEnd reference is returned. But when I try to display values of these properties right on PageEnd, I've got NullPointer exception, i.e. values are lost when moving from PageStart to PageEnd. It looks like new controller instance is created for PageEnd.

So, my question is: what kind of redirect happens when we return some page from apex:page action attribute's method ? Is it always external redirect even if I'm returning another page which uses exact the same controller ? Can I somehow force it to be internal redirect and keep state (set redirect to true on page ref doesn't help).

Any suggestions would be appreciated, and thanks in advance for you help guys.