Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to code this in JSF?

 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd like to code something that is not quite a <h:commandLink> and not quite an <h utputLink>:

1.It should be rendered as an HTML link.
2.Clicking on it should not submit the form (unlike commandLink).
3.It should carry out on some action on the server (like the action property of a commandLink), and based on the result of that action foward or redirect you to an appropriate page in the web app.

Does anyone know how to do this?
 
Rick Beaver
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will a command link with immediate=true and action=#{yourBean.yourMethod} work for ya?
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rick Beaver:
Will a command link with immediate=true and action=#{yourBean.yourMethod} work for ya?


Unfortunately not, because there are already immediate fields I don't want to figure into this interaction. Also, I don't want this page to be created on the server at all because (1) there's no values being posted and (2) this isn't the page that will be rendered.

What I've noticed as I've been developing in JSF is that a lot of unnecessary execution happening on the server, and the more I use JSF the less I like it. My biggest beef is that it's a page-centric framework rather that a action-centric framework. For example, when the user clicks on a link or button they are primarily asking for an action to be done, and there may be no need to recreate the structure of the current page to do this action.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic