It's not a secret anymore!
The moose likes JSF and the fly likes JSF 2.0 and AJAX Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF 2.0 and AJAX Problem" Watch "JSF 2.0 and AJAX Problem" New topic

JSF 2.0 and AJAX Problem

Dominik Müller
Ranch Hand

Joined: Apr 28, 2009
Posts: 36
Hi all,

facing a strange problem for some days when build up a very simple General-Detail-View. I reproduce the issue with a (even more simple) demo application.

[The Idea]
- select from a list box an item
- a detail view appears. which edit the underlaying data-object
- save the date

[The Problem]
- selecting an item from a listbox and show the detail-data with ajax-request work.
- the FIRST time after changing the item-list i edit a field from the detail-data and submit the form, the changes are not saved in the bean (and the action-method isn't invoked)
- the SECOND time (without changing the item, just edit the field again) works (model-update and action-method)
>> Problem doesn't occurs when i deactivate the ajax-change event on the listbox and make a full request

[The Code]
Simple Java Bean:

the handler

the page:

I am out of ideas, maybe someone else can test it and see my mistake .

Thanks a lot
Dominik Müller
Ranch Hand

Joined: Apr 28, 2009
Posts: 36
Hi All,

i have no ideas, removed ajax functions from my application for resolving the problem, but that isn't a real good solution.

To test it, i uploaded a little war file, including the sources, i hope somebody can test it and maybe find the solution.

Thanks a lot again.
Ilari Moilanen
Ranch Hand

Joined: Apr 15, 2008
Posts: 199
Just a guess, but maybe something to test.

You are updating a value in different form there. Is it possible to combine those two forms and send both requests (ajax and full) from the same form?
I agree. Here's the link:
subject: JSF 2.0 and AJAX Problem
It's not a secret anymore!