>>>>> On Tue, 19 Jan 2010 07:06:08 -0800, Ed Burns <Ed.Burns_at_Sun.COM> said:
>>>>> On Mon, 18 Jan 2010 17:10:59 -0800 (PST), webtier_at_javadesktop.org said:
>> Until then what choices do I have ?
EB> I'm investigating this now.
> This means I cannot have multiple forms within same page but only one
> h:messages tag shared and refreshed from any of the forms ?
Looking at the docs for <f:ajax> you will see that this is calling for
client ids. Therefore, if you want to reference the one h:messages, you
must specify the absolute client id, which is ":messages". Using this
as the id allows the page to work without error.
However, you've hit upon a commonly made mistake. I checked in my new
book, <
http://bit.ly/edburnsjsf2>, but unfortunately this gotcha is not
called out explictly. I have added it to the errata for the book.
> However when changing the input texts and the ajax request is posted ,
> the messages show only one at a time .
I think this is because the default behavior of f:ajax is to only submit
the value of the component in which the f:ajax is rendered. Take a look
at the "execute" attribute documentation.
> The error reporting now is closer to the regular submit behaviour
> however the error message for the title is displayed too early since
> the user did not have the chance to enter the value .
You might consider using up jsf.ajax.request() javascript function.
That way, you can have some local javascript that causes the ajax
transaction to happen whenever you want.
--
| ed.burns_at_sun.com | office: 408 884 9519 OR x31640
| homepage: | http://ridingthecrest.com/