Subscribe via Feed
, Aug 8, 2010 12:36:32 PM
7 responses to Using Navigation Rules in Your XPages Application
Thimo Jansen, May 22, 2011 7:20 PM
Jeremy, are you sure that <from-view-id>NavigationSample.xsp</from-view-id> works? I've tried everything I could come up with but can't get it to work. Its for login.xsp, tried a slash in front of it, with wildcards (like "*login*", but no success. When I replace the "/login.xsp" below with "*", the rule works as expected. Is there something I'm missing?
Thimo Jansen, May 22, 2011 6:55 PM
A nice addition is that you can add "<redirect/>" to an entry in the faces-config.xml. This is the same as 'redirect="true"' in an XPage navigation rule and sends a redirect back to the browser. Consider the following use-case, without the redirect:
1. User is on /login.xsp, fills correct credentials and clicks"Login"
2. Navigation rule returns the content of /home.xsp, but the URL on the browser still reads "/login.xsp"
3. When the user reloads this page, the login credentials will be posted again to the server
Use of the redirect property prevents this and redirects the browser to the correct URL which is then retrieved with a GET.
John Mills, August 9, 2010 12:59 PM
That was it. It was the type that caused the problem. Works like a charm..
Thanks for all the help..Have a great day..
Jeremy Hodge, August 9, 2010 11:53 AM
@Stephen - Thanks ... Yes, you are right, the nav property panel is there ... I'm just so used to the All Properties that's where I go .. I find, outside the "data" panel, the other property panels to be "fluff" since they don't always provide all the options, and bury the rest of the properties. Personally, I'd like to see the individual property panels go away, and the all properties be given the focus ... the individual property sheets can be helper dialogs from there, but this multiple vectors bit with the individual property sheets is rather pointless and less useful.
As for the use of the faces-config to add navigation rules, its the only way to specify application-wide navigation rules. Granted if you want to manage your rules only at the page level, then you don't have to, but it seems to me to be much more beneficial to standardize your rules across the entire application. This makes maintainability so much easier.
Agreed on the editor for the faces-config too ... if I had some time :)
Stephan H. Wissel, August 9, 2010 12:37 AM
nice one. Love your JSF for DDE series. Now someone needs to write an DDE plug-in to edit the faces-config in a more orderly fashion :-).
Btw. the navigation can be edited in a property panel in a page, no need to go to all properties or the global navigation in faces-config... but it's cool.
Jeremy Hodge, August 8, 2010 9:14 PM
Hey John, can you send me an email with the source code to your class and the content of your faces-config file ... I'll be happy to take a look and see what the deal is.
Also, I'm assuming that in your comment the "HellowWorld" is a typo (the extra w ... if its not, that might be your problem)
John Mills, August 8, 2010 8:20 PM
I was trying to follow your article in the xPages blog about Writing a Managed Bean..
I have copied the Java source and xPage source from the article and
added the src folder to the build path and edited faces-config.xml file to include the managed bean.
But, when I open the xPage, it throws an exception
Can't instantiate class: 'com.InfoWorld.MyFirstBeans.HellowWorld'
(My package name is "com.InfoWorld.MyFirstBeans")
It looks like, the xPage is not able to find the class. I am not sure what I did wrong. Is there anything comes to your mind that might have caused the problem?
I know this is the base for all your subsequent articles and I can see a lot of possibilities using this method..Greatly appreciate any light you could shed on this.
Thanks a million..