• Post Reply Bookmark Topic Watch Topic
  • New Topic

commandLink doesnt do anything.  RSS feed

 
Edward Fernando
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
helllo i'm a first timer at jsf, and right now i'm learning how to use ajax in jsf. i got a problem when i click a command link i want to change in a content, but when i run my web and i click the command link it didn;t do anything.

this is the source



in this code when i click the Home button it suppose to change the ouput text to a string that store in my bean.
this is my bean



at first the output text value is the same as the string i store in the bean. but when i click the commandlink, it didn't do anything, is there something wrong with my code? please help, thanks.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't recommend using raw HTML in a JSF View Definition unless there is no alternative. Especially when doing grids (use h:panelGrid) or tables (h:dataTable).

This is also bad practice:


An action is supposed to reference a method, not call it. The proper form, therefore is:


Probably your biggest problem, however, is that you are attempting to define a form in the middle of an HTML table and that's not even proper in raw HTML. Wrap the h:form around the table.

One thing that can help with a lot of JSF problems is if you put an "h:messages" tag in the View Definition. That will report any unexpected errors relating to JSF validation.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!