Yes, I forgot to mention.
MyBean has session scope.
The updateActionListener calls just a simple setter:
public void setAvalue(String bla) {
this.avalue = bla;
}
The action (simplified, I just don't want to post not relevant
information)
public String doIt() {
String mystring = this.getAvalue(); //just simple getter
...
}
The problem is that getAvalue returns 1 instead of 2 after clicking back
button.
getId() and setId() are also simple getters and setters without any
additional logic.
Michael
-----Original Message-----
From: Andrew Robinson [mailto:[EMAIL PROTECTED]
Sent: Mittwoch, 2. August 2006 17:20
To: MyFaces Discussion
Subject: Re: Browser Back Button
What is the code in the Java? What scope is MyBean?
On 8/2/06, Michael Heinen <[EMAIL PROTECTED]> wrote:
>
>
>
>
> I have sometimes a problem with the Browser Back button.
>
> My app runs with server side state saving and
NUMBER_OF_VIEWS_IN_SESSION is
> set to 20.
>
>
>
> I use an immediate command link with an updateActionListener that
updates an
> iframe.
>
> <h:commandLink action="#{MyBean.doIt}" immediate="true"
target="iframe1">
>
> <t:updateActionListener property="#{MyBean.avalue}"
> value="#{MyBean.id"/>
>
> </h:commandLink>
>
>
>
> ClickFlow:
>
> Start Page1: MyBean.avalue=1
>
> Navigate to Page2: MyBean.avalue=2
>
> Click doIt on Page2: MyBean.avalue=2
>
> Click BackButton --> goes one page back in the iframe
>
> Click BackButton --> Page1 is redisplayed (so far so good)
>
> Click doIt on page1: MyBean.avalue=2
>
>
>
> But MyBean.avalue should be 1 in this case!!!
>
>
>
> I thought that the BackButton is supported with server side state
saving and
> NUMBER_OF_VIEWS_IN_SESSION.
>
> What can I do in this szenario?
>
> Is this always working this way or is this caused by the immediate
command
> link?
>
> I cannot change to client side state saving!
>
>
>
> I tried also to replace the iframe with an ajax update but the back
button
> effect is the same.
>
> Any help is appreciated
>
>
>
> Michael