-
1. Re: run some ajax4jsf stuff onload?
sergeysmirnov Apr 12, 2007 12:16 PM (in response to snod0g)just use a4j:jsFunction
-
2. Re: run some ajax4jsf stuff onload?
snod0g Apr 12, 2007 1:25 PM (in response to snod0g)so i just put it at the top of the page after the tag? i was looking at the documentation and i noticed its using data.subProperty1, data.subProperty2, is this a case where the bean.someProperty is an object with its own properties subProperty1 and subProperty2?
<a4j:jsFunction action="#{bean.action}" data="#{bean.someProperty}" name="callScript" oncomplete="myScript(data.subProperty1, data.subProperty2)"/> -
3. Re: run some ajax4jsf stuff onload?
sergeysmirnov Apr 12, 2007 1:38 PM (in response to snod0g)You can put it anywhere. Just do not forget to have a h:form around it. Use onload to call the function by name.
.... <body onload="callScript()"> ... ... <h:form> ... ... <a4j:jsFunction action="#{bean.action}" data="#{bean.someProperty}" name="callScript" oncomplete="myScript(data.subProperty1, data.subProperty2)"/> ... </h:form> ... </body>
-
4. Re: run some ajax4jsf stuff onload?
kingcu Jul 9, 2007 5:36 PM (in response to snod0g)What if I use facelets template, where do I specify that body onload?
-
5. Re: run some ajax4jsf stuff onload?
sergeysmirnov Jul 9, 2007 11:59 PM (in response to snod0g)<script type="text/javascript">document.onload = callScript;</script>
-
6. Re: run some ajax4jsf stuff onload?
kingcu Jul 12, 2007 12:16 PM (in response to snod0g)"SergeySmirnov" wrote:
<script type="text/javascript">document.onload = callScript;</script>
This didn't work for me. I had to put the onload in the template where the html body tag is defined. -
7. Re: run some ajax4jsf stuff onload?
danielkard Jul 13, 2007 4:38 PM (in response to snod0g)try:
<script type="text/javascript"> callScript(); </script>
anywhere your page -
8. Re: run some ajax4jsf stuff onload?
anonyin Jan 31, 2011 9:16 PM (in response to danielkard)I tried this and is not working. I have the same issue with facelets template. I want to load something using javascript only in one of the JSFs.
Did you figure this out ?