Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Action's not performed on first time  RSS feed

 
Prakash Venkatesh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!