[aida] Ajaxification of web elements
janko.mivsek at eranova.si
Fri Nov 9 00:01:26 CET 2007
Andreas Petermann wrote:
>>> I have created my own Component where a user can input some data. How is it possible to commit all values during one submit? Ajaxify one Element works fine. I have tried out to add the onClick action manually but with no success. In this way the component will not be correct updated.
>> So you have some form elements on that component and you'd like to
>> submit them all at once. Isn't simply a submit button good enough
>> solution for that? Do you have other components with its own form
>> elements and you'd like to isolate submit from them?
> thanks for your reply. When I use a submit button, the whole page will
> be resend and all things should be rendered again. No, in this case I do
> not want to isolate other form elements from this one. I want to do a
> login via ajax. So i should submit a username and a password. All other
> apps of my site test the current user and modify the rendering stuff
> when the current user is only guest. So the user can browse my side and
> optional log in without refresh the whole page.
I would do a kind of trick in your case. Send form elements
#onchangePost, then put login button #onClickUpdate: aComponent. At the
start of that component check self session lastRequest isAjaxRequest and
if true, activate a login procedure, because you already have an
username and password posts from form elements.
So, username and password will be Ajax posted and by clicking a submit
button you update that whole component and because this is an Ajax
update, a login will actually be done.
I hope that this helps you a bit...
Smalltalk Web Application Server
More information about the Aida