Turns out I had a listview on the page which was generating new versions of the page. Setting setReuseItems(true) solved the versioning problem. (Which was basically the only real problem I was having).

Regards,
Sebastiaan

Sebastiaan van Erk wrote:
Hi,

Thanks for the reply!

Actually, in some cases the page is not stateless all the time (which is why I use that strategy), i.e. it starts out on a stateless form. Another reason why I use it on non-stateless pages is because the URL looks so much better. ;-)

Anyway, I do use Link, so yes that would make it stateful I guess. I would like to do it in a non-stateful manner, but I don't really know how. Currently my ChangeLocaleLink looks like this:

public class ChangeLocaleLink extends Link {

    private final Locale locale;
public ChangeLocaleLink(final String id, final Locale locale) {
        super(id);
        this.locale = locale;
add(new ContextImage("flagImage", new Model("images/flag_" + locale + ".gif")));
    }
@Override
    public void onClick() {
        getSession().setLocale(locale);
    }
@Override
    public boolean isEnabled() {
        return getSession().getLocale() != locale;
    }

}

Regards,
Sebastiaan

Matej Knopp wrote:
If the page is stateless, why are you using hybrid url coding strategy
for it? You should just mount it.
Also, even more important thing, is the page really stateless?
Stateless pages don't have versions.
Link is not a stateless component so if you use it on a page, it will
make it statefull.

As for why the locale changes version, I don't know. How does your
link's onClick handler look like?

-Matej

On Nov 12, 2007 6:33 PM, Sebastiaan van Erk <[EMAIL PROTECTED]> wrote:
Hi,

I have a page mounted using the hybrid coding strategy. In the page I
have a language link, to change the locale in the session (to show
another language). Now what happens is, I have

http://mysite/mypage.1.1 (in Dutch)

<click English link>

http://mysite/mypage.1.2 (in English)

<click browser back button>

http://mysite/mypage.1.1 (in Dutch)

<click browser reload button>

http://mysite/mypage.1.1 (in English!)

I was wondering if I could make it switch language without changing the
page version, since it seems that it makes no difference anyhow: the
language is determined by the session and not by the page version (as
proved by the reload above).

Furthermore, the page is *stateless*, so I was wondering how I could
keep it that way even with the language link. The problem is that the
language link is in the base page and knows nothing about the real page
(if it's bookmarkable, mounted, etc). I currently use a Link and just
set the locale on the web session...

Regards,
Sebastiaan


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to