This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in creating a search result page  RSS feed

Victor Williams Stafusa da Silva
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I am new to JSF and I am having trouble in creating a search result page in JSF.

This is in my file "/telas/buscar_exame.jsp":

This a snippet of my faces-config.xml:

My managed bean has an attribute called "visualizadorExames" which is a Collection<Visualizador>. There is a getter for this too.
The class Visualizador is an inner class of my managed bean (i.e. a smelly ugly hack) and has an attribute "exame" that is just an entity class already populated (the thing shown in the result).
The class Visualizador has a method prosseguir() which put the corresponding "exame" attribute in another managed bean (used in the next screen) and return the String "prosseguir" (don't looks good too).

Well... The result is a disaster. There are 2 problems here. The first is that my panel is not rendered correctly (the search results looks messy). But my big show-stopper problem is that clicking in a result does not navigate to the next page, instead it reloads the search result page.

About the nesting of the <a4j:form>, this is because the content outside the <a4j:repeat> tag needs to use the external form (ie, it is the search form and the search results needs to be in the middle of it), while the <a4j:form> nested in the <a4j:repeat> tag is intended to be the form that submits to show the next screen.

I am a novice to JSF. I just started to study it seriously three weeks ago.

Can somebody help me?

Edit: debugging it, looks like that the prosseguir() method is never called. So i wonder what is being called when I click the link.
About the rendering problem, I already tried to change the order of the tags, but no success.

Edit 2: I fixed the rendering problem and cleaned up the ugly stuff thanks to this.
But it still not working, it still comes back to the same page. I did what was in the article, but used <a4j:repeat> instead of <h:dataTable> because dataTable did not played well with <a4j:form> (yes, I tried with dataTable).
Tim Holloway
Posts: 18531
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From what I can tell from the RichFaces documentation, a4j:form isn't something that you really need anymore. An h:form should do it.

However, I'm curious about how the datatable tag "doesn't play well with a4j:form". I've never seen any problems.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!