-
1. Re: How to get page view-id variable in a SB???
asookazian Aug 27, 2007 4:55 PM (in response to asookazian)sorry, above should read as follows in pages.xml:
<page view-id="/CustomersEdit.xhtml"> <restrict>#{s:hasRole('admin')}</restrict> </page>
-
2. Re: How to get page view-id variable in a SB???
asookazian Aug 27, 2007 4:56 PM (in response to asookazian)sorry again! why can't we edit our own posts????
as follows:<page view-id="/CustomersEdit.xhtml"> <restrict>#{authorizor.display}</restrict> </page>
-
3. Re: How to get page view-id variable in a SB???
dustismo Aug 27, 2007 5:53 PM (in response to asookazian)Not sure exactly what you are trying to do, but is this what you are looking for?
FacesContext.getCurrentInstance().getViewRoot().getViewId();
-Dustin -
4. Re: How to get page view-id variable in a SB???
asookazian Aug 27, 2007 6:44 PM (in response to asookazian)yes thx! that works. I've created an Authorization SLSB to use in place of #{s:hasRole('admin')}. We are trying to avoid hard-coding and call the isDisplay() method in the SLSB authorizor to do a DB lookup to determine what role(s) is needed to access the current .xhtml (which you have told me how to do!)
thanks again.
this type of functionality needs to be added to the Seam framework. Maintaining the roles, xhtml names in a props file or DB table is better than hard-coding the role names in the .xhtml or pages.xml... -
5. Re: How to get page view-id variable in a SB???
asookazian Aug 27, 2007 7:21 PM (in response to asookazian)how do you get the full relative path from root or web context all the way to the name of the facelet?
example: /inventory/a/b/c/d/process.xhtml
thx. -
6. Re: How to get page view-id variable in a SB???
asookazian Aug 28, 2007 1:57 AM (in response to asookazian)this would be similar to:
HttpServletRequest.getContextPath();
so is there a way to do this with Faces/Seam??? -
7. Re: How to get page view-id variable in a SB???
pmuir Aug 28, 2007 5:14 AM (in response to asookazian)IIRC
facesContext.getExternalContextI().getRequestContextPath() + "/" + facesContext.getViewRoot().getViewId();
-
8. Re: How to get page view-id variable in a SB???
asookazian Aug 28, 2007 11:39 AM (in response to asookazian)thx Pete, that worked.