I'm new at Ajax and JSF/A4J, and I'm trying to learn the very basic of it, but I found that behaviour for A4J is quite different from standard JSF (either RI or MyFaces). The first screen I made is login screen. Normally, using <h:commandButton>, when action controller method was called, whole page will be refreshed. Expecting following behaviour, I'm trying A4J:
1. When button "Login" was clicked, page will display message, such as "Validating user xxxxxx, please wait" and the login button itself will be disabled until request complete.
2. When request complete, hide message "Validating user xxxxxx, please wait", and (since this is Ajax studying) instead of redirecting page, I want the Login button to re-enabled.
So I write following jsp code
while this is the backing bean
But this approach does not work, the message "Validating user xxxx, please wait" is displayed after I clicked button Login, while the request itself still processed at server, but button login still enabled.
After validateLogin() complete, message still displayed, and no changes on button login.
So I try the second approach, based on Richfaces' user guide. Instead of disabling button at backing bean, I do it via jsp as follows
OK, the button behave as expected, but no "Validating user xxxx" message displayed.
I think I can't reference component, changing it's visual behaviour from backing bean, since the page is not reloaded all, Can I? So how can I get those behaviours?
Another question, when I add code at validateLogin() as follows:
How can I display appropriate error message?
Any references or solution? My google search did not find anything useful