File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes commandLink not working properly Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSF
Reply Bookmark "commandLink not working properly" Watch "commandLink not working properly" New topic
Author

commandLink not working properly

Henrique Sousa
Ranch Hand

Joined: Apr 29, 2004
Posts: 92
Hi ranchers,

It seems that my incursion in JSF is causing me more head aches than I expected. I had a working page with four commandLinks and I needed another page just like it (just changing a dataTable, managed bean used, and the commandLinks outcome). So I copy-pasted the file and changed whatever was needed; I also added the desired outcomes to navigation cases in faces-config.xml.
I think it should work, but it does not. The page displays correctly, but just one of the commandLinks work. The others submit the form (no JS exception), but the page just reloads. I tried clearing the browser cache, reordering and grouping the navigation cases in faces-config.xml, but nothing happened. I even changed the commandLink action to an invalid outcome to try and get an error, but nothing happened.
Some code snippet to show what I am talking about:

faces-config.xml:


/event/list.jsp:


Did I forget anything? Oh! The file /event/create.jsp is accessible and working perfectly as I accessed it directly. Thanks


Henrique Sousa<br />SCJP 1.4<br /> <br />All men die, not all men really live - Braveheart, 1995
Sergey Smirnov
Ranch Hand

Joined: May 29, 2003
Posts: 167
Most likely, you have a validation or convertation problem for your form. Try to add <h:messages /> somewhere on your page for the testing purpose.
First link works because it bypasses lifecycle phases with validations or convertations so far as immediate="true"

--
Sergey : jsfTutorials.net
Henrique Sousa
Ranch Hand

Joined: Apr 29, 2004
Posts: 92
Thanks Sergey, I had a date field without a converter (even though I never actually put anything in it). I organized the immediate fields and commands and everything works now. Thank you!
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: commandLink not working properly
 
Similar Threads
jsf newbie, navigation not working
commandLink param problem
h:commandLink issue
Navigation using h:commandLink
navigation problem from main menu