Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

commandLink not working properly  RSS feed

 
Henrique Sousa
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sergey Smirnov
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!