| Author |
Message |
![[Post New]](/rsf/templates/default/images/icon_minipost_new.gif) 13/03/2009 13:40:51
|
Azanchetta
Newcomer
Joined: 13/03/2009 12:40:12
Messages: 3
Offline
|
Hi there!
I'm new using RSF and I'm trying to apply AJAX functionalities into a project following the example "RSF and AJAX" at rsfwiki.
I followed that example strictly but I faced the strange situation: the javascript function initMyAjaxStuff(), added by the the UIInitBlock.make function at the beggining of the page execution, isn't finding the input-text object of ID="input_field" when executing the document.getElementById() function inside it. Trying with another input-text element added just for test (but this one not modified by RSF as the first one), the same error occuried. It seems that the javascript function added by the UIInitBlock.make operation is executed even before the page is loaded, so no elements are found (I used the Firefox WebDeveloper Plugin for find these javascript errors).
I searched at the forum but didn't found anything similar to this situation.
PS: English is not my native language, so I would like to ask you to not be affraid of saying that you didn't understand something I've said
|
"We create dragons for the same reason we create God: because we know that the life has no meaning without them." |
|
|
 |
![[Post New]](/rsf/templates/default/images/icon_minipost_new.gif) 13/03/2009 14:25:54
|
antranig2
Request-scope Wrangler
Joined: 05/06/2006 02:51:30
Messages: 24
Offline
|
Yes, it is executed at page load. To make sure that elements can be found by id, you must make sure that the markup corresponding to the UIInitBlock is placed *later on*, that is, further down in the HTML document than any elements its tries to refer to.
Hope this solves your issue,
Cheers,
boz.
|
|
|
 |
![[Post New]](/rsf/templates/default/images/icon_minipost_new.gif) 13/03/2009 16:43:56
|
Azanchetta
Newcomer
Joined: 13/03/2009 12:40:12
Messages: 3
Offline
|
Thanks very much antranig,
the problem was solved just by passing the javascript block with the rsf:id="init_js" from the beggining to the end of the HTML page.
So, in the end it was not a RSF problem, but a javascript problem...
Thanks again.
|
"We create dragons for the same reason we create God: because we know that the life has no meaning without them." |
|
|
 |
|
|