users@woodstock.java.net

Re: Asynchronously submit and refresh. How to?

From: Dan Labrecque <Dan.Labrecque_at_Sun.COM>
Date: Wed, 21 May 2008 14:52:47 -0400

Stefan Bley wrote:
> Hi Dan,
>
> l http://www.nabble.com/file/p17357332/AsyncRefresh.zip AsyncRefresh.zip et
> me answer your questions:
> 1. Yes, just "form1:<component_id>"
> 2. Yes
> 3. There is no validation and no required attribute
> 4. The bean should have request scope, I have not tested it using session
> scope.
>
Wish you would have tried this. Might have saved me from testing your
app. :(

> 5. If I use a page submit the dropdown dd2 is filled correctly.
>
> Please have a look at this sample project so you can reproduce this error.
>

Looking at your code, I see that the menu's value change listener method
is used to set dd2DefaultOptions. There seems to be a timing issue
related to when JSF updates the text field and calendar values.
Obviously, these values are not available when the menu's change
listener is fired because the option labels read "null".

That said, instead of setting dd2DefaultOptions via the change listener
method, perhaps you can just clear it? Setting options via the getter
method seems to work much better. When this method is invoked during the
JSF rendering phase, the text field and calendar values are available.

Dan

> Thank you for help,
> Stevy
>
>
> Dan Labrecque wrote:
>
>> Note that if you
>> can retrieve the text field value during a simple page submit, using an
>> Ajax request should yield the same result.
>>
>> 1. Are you using the correct, fully qualified component ID?
>> 2. Does the backing bean have the correct getter/setter signature
>> expected by JSF?
>> 3. Are there any validation or required errors preventing components
>> from being updated?
>> 4. What is the behavior when the backing bean is session scoped?
>> 5. What is the behavior during a page submit?
>>
>>