tags:

views:

38

answers:

1

What is the best way to have a back link?

I tried the following:

<ice:commandLink onclick="history.back();">
       <ice:graphicImage value="/images/btn_back.gif" title="Back"/>
</ice:commandLink>

However, this doesnt seem to be exactly the same as clicking the back button on the browser. Specifically I get some problems with managed beans not being initialized when using the javascript back which doesnt happen if I use the browser back button.

(using jsf 1.2 with icefaces 1.8.3 in firefox).

A: 

I agree with the comment about a back button.

Instead, save in the session the view id where the user came from (using FacesContext.getCurrentInstance().getExternalContext()) and use:

session.get('previousView') in h:outputlink. (there is no reason to use a submit link for that)

Odelya
can you provide some more details...not exactly sure what you mean.
DD