You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 23 Members of 4546 |
| Forum: Seam Users |
17. May 2008, 02:39 CET | Link |
Hello,
I would like to know if there is any way to know what the current view-id is from a web page.
I'm using <a:include> tags to add common
functionality to several web pages. However in some cases one element of the include page fragment will be different in one page from all the other pages where the page fragment is used.
That case could be handled with some kind of EL expression which would return what the current (parent) view-id is.
Thanks.
This will tell you the URL if that helps...
And this will tell the view:
but I don't know how to do that from EL (other than putting that java code in an EL function or in a getter on some component).
There's a seam manager component that wraps the current faces context, so you can just do:
#{facesContext.viewRoot.viewId}in EL.
or
#{facesContext.viewRoot.viewId}or
#{view.viewId}