This content has been marked as final.
Show 6 replies
-
1. Re: How to trigger a bean function on rendering
ilya_shaikovsky Jan 29, 2009 10:54 AM (in response to chris24)For ajax requests use oncomplete attribute to fire some JS functions or maybe even new ajax requests after current completed.
If you talking about standard GET to page or POST with standard controls then the answers only common ones - onload event or maybe some inline scripts in the page end. -
2. Re: How to trigger a bean function on rendering
dxxvi Jan 29, 2009 11:07 AM (in response to chris24)"chris24" wrote:
... to trigger bean fucntions with RichFaces after a page is completely loaded ...
Seam can do that. -
3. Re: How to trigger a bean function on rendering
dxxvi Jan 29, 2009 11:08 AM (in response to chris24)"dxxvi" wrote:
"chris24" wrote:
... to trigger bean fucntions with RichFaces after a page is completely loaded ...
Seam can do that.
Oh, I'm wrong. Seam will execute that bean function before the page is rendered. -
4. Re: How to trigger a bean function on rendering
chris24 Jan 29, 2009 11:09 AM (in response to chris24)can you give an exapmle how to implement this?
-
5. Re: How to trigger a bean function on rendering
nbelaevski Jan 29, 2009 7:49 PM (in response to chris24)You can try this:
<a4j:jsFunction name="coolMethod" ... /><script type="text/javascript">coolMethod();</script>
jsFunction can be called inside jQuery(document).ready(): http://www.learningjquery.com/2006/09/introducing-document-ready if you are in the case when defining inline onload handler for BODY element is not possible for some reason. -
6. Re: How to trigger a bean function on rendering
chris24 Jan 30, 2009 4:56 AM (in response to chris24)OK, thanks a lot!
Actually i got it with your help. Here is the Code:
<a4j:jsFunction name="getContactList" immediate="true" action="#{myBean1.fetchContacts}" reRender="contacts" />
<a4j:jsFunction name="getAddressList" immediate="true" action="#{myBean2.fetchAddresses}" reRender="addresses" />
//<![CDATA[
Event.observe( window, 'load', function() {
getContactList();
getAddressList();
} );