• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Action's not performed on first time

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Friends,

I have a search form created using JSF tags. In this form we have 7 buttons performing unique operations on the search form page.

The problem is, when I come to this page for the 1st time and click on an any of the button. The page is submitted but no action is performed and the page returns back with the same data. When I click the same button for the second time. The action method is invoked and I am getting the expected result.

I went through the couple of forum posting that talks about it this issue but the solution mentioned in that threads did not work for the problem I am facing.

For your information,

1. I am coming to this search page from my home page.
2. We are using tiles with JSF
3. We have 1custom JSF tags in the search page.

I found the reason. In our JSP page we are having 3 dropdown list box and each of the them attached to respective binding method to perform business logic. At the end of the method, we are adding the below line:

FacesContext.getCurrentInstance().renderResponse();

When we comment this line, and execute the page and press any buttong, the binding method associated with the button is invoked.

Where as when I change the value in the dropdown list box, it invokes the associated binding method for the dropdown list box and it does not comes back to the same page but navigates to some other page.

Is there any way to solve this problem without commenting the FacesContext.getCurrentInstance().renderResponse(); line and make the button to submit on 1st time click.

Your inputs will be appreciated.

Advance thanks

Prakash
 
Prakash Venkatesh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fixed the issue.

The problem originated in the queueEvent() of the custom component decode method. Once I added a conditional statement to verify whether the action is initiated from the custom component or other components and allowing the control to reach queueEvent() statement. This solved the navigation issue and removed the renderResponse() line from the valuechangedlistener method. The page is working as expected.

Thanks for your time and comments.

Adios,
Prakash
reply
    Bookmark Topic Watch Topic
  • New Topic