You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dave <ja...@yahoo.com> on 2009/06/11 03:39:09 UTC
Re: trinidad: how to add javascript/style/body onload programmatically
what i meant is how to use Trinidad java API to do that. Tomahawk's AddResource allows users to add css style and javascript programatically. I am wondering if Trinidad has the similar functionalities.
Trinidad has ExtendedRenderKitService:
FacesContext facesContext = FacesContext.getCurrentInstance();
ExtendedRenderKitService service = (ExtendedRenderKitService)
Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
service.addScript(facesContext, scriptcode);
but it add inline javascript code only. It can not do the things I mentioned in the previous email.
Thanks.
dave
--- On Wed, 6/10/09, alvaro tovar <al...@gmail.com> wrote:
From: alvaro tovar <al...@gmail.com>
Subject: Re: trinidad: how to add javascript/style/body onload programmatically
To: "MyFaces Discussion" <us...@myfaces.apache.org>
Date: Wednesday, June 10, 2009, 10:11 AM
for the 1 you can use ${}
for the 2
<body onload="callJS()">
2009/6/10 Dave <ja...@yahoo.com>
For trinidad, 1. how to add javascript/style inside html head programmatically? For example,<link rel="stylesheet" href="/my.css" type="text/css" /><script type="text/javascript" src="/my.js"> 2. how to add body onload script?
Thanks for
help.Dave