• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Problem in creating a search result page

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Saloon Keeper
Posts: 28486
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic