Skip to main content

f:ajax and submitting forms, with @ConversationScoped beans

2 replies [Last post]
hirowla
Offline
Joined: 2009-04-22

I was wondering how to deal with a form using f:ajax to validate fields. The HTML fragment is something like this (incomplete but you get the idea):

I have two problems - one with this, the other if I try a particular solution:

If I type into this field and then click the submit button straight away, I get the following error as a popup: "httpError: The Http Transport returned a 0 status code. This is usually the result of mixing ajax and full requests. This is usually undesired, for both performance and data integrity reasons."

I gather this is because I have two Ajax requests going on simultaneously (one for the field, the other for the form submission). Often I get an error when this occurs.

One solution was suggested at http://weblogs.java.net/blog/driscoll/archive/2009/10/01/mixing-ajax-and... . But if I add a to the h:commandButton, I have problems with the backing bean - the password is not set as part of the backing bean, which leads to redisplay problems.

Has anybody seen this problem? I think part of it has been seen in https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=992 but couldn't be reproduced - I can reproduce it all the time.
Is this a suggested way to work around this, so my backing bean gets my password value?

Thanks,

Ian

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
vesuvius
Offline
Joined: 2007-06-02

Try adding something like [b][/b] or [b][/b] to the button.

By the way, why do you do:

[code]

[/code]
instead of

[code]

[/code]
or

[code]

[/code]

hirowla
Offline
Joined: 2009-04-22

Your first suggestion works (although I'm sure that teh 2nd one would work if that was the only field, which in reality it isn't).

In terms of why I did the jsfc thing - I probably originally did it as an input field, then changed my mind and forgot to remove the jsfc part!