3 Replies Latest reply on Sep 22, 2008 5:23 AM by Francisco Jose Peredo Noguez

    Execute arbitrary method upon specific page navigation

    jk;l jkl; Expert

      I have a page (destination.xhtml) that needs to be modified programmatically depending on whether navigation came from source1.xhtml, source2.xhtml, etc. I've created the methods to do the appropriate page modification for each of these cases, but I can't tell whether Seam will allow me to use them on a navigation-specific basis. The following scenarios don't work:

      1) I can't use the action element in pages.xml for the page I mentioned, because destination.xhtml would need a different method run based on whether we were previously redirected from source1.xhtml, source2.xhtml etc.

      2) I tried to use an evaluate attribute for the navigation element in pages.xml so that I could customize navigation specific to source1, source2, etc, but that didn't work because it's looking for a property rather than a method (prepending the method name with get doesn't work, and is a workaround at best). I tried to use

      3) I then tried to use a raise-event element under navigation, but that didn't work because the observer method is called before the redirection occurs, so any programmatic modifications of the page work on source1, source2, etc and not destination.xhtml.

      How can I execute an arbitrary method for a specific page navigation? If this doesn't exist, I'd be surprised.