thanks martin,

yes, i saw this blog post with a more elaborate solution than i was hoping for:

http://jroller.com/page/cenkcivici?entry=custom_jsf_navigation_handler_for

but since it was posted on friday the 13th, i would never use it cause it's bad luck ;)

but seriously, i was hoping for something a bit less involved.

i couldn't get the history.back() bit to work with either a commandButton or commandLink,
what i currently have is the following:

     <f:verbatim>
       <input type=button onclick="javascript:history.back()"
         value="Back" />
     </f:verbatim>

which has the desired effect, but it has the drawback of not being able to use the messages.properties file
and value="#{messages['button_back']}" for localization.

anyone have any ideas for getting the localized value in there instead of hardcoding "Back"...?

Martin Marinschek wrote:
Hmm...

Well, if you use client-side state saving ( or server-side state
saving and MyFaces after 1.1.1) you can use that trick above.

If you want to post-back to the server in between, you can write a
custom Navigation-Handler and configure that in your faces-config.xml.
This navigation-handler would need to store a stack of pages visited
somewhere and then just go back if the outcome equals to some
predefined string (e.g. "back").

I'm sure somebody can jump in with some source to support you, right?

regards,

Martin

On 1/31/06, tony kerz <[EMAIL PROTECTED]> wrote:
i understand there are some far reaching issues with the back button,
with respect to the back button leaving things in a bad state,
but i'm not looking for the back button holy grail (just now).

my question is simply what would be the best way to get a button
on a jsf page which mimics functionality of browser's back button:

the equivilent of the ever popular:

  <a href="javascript:history.back()">Back</a>

?

thx...



--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


Reply via email to