You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Aldo Vadillo Batista <al...@gmail.com> on 2008/08/12 13:20:43 UTC

Trinidad: how to include javascript files

I have a javascript file that include several validation functions.
I'm developing an application that uses apache trinidad. When I try to
include my .js file, the style of the page is not included.
I mean: it seems like the framework doesn't look for the trinidad skin
associated to it.

Is there any way to include the .js file?

Re: Trinidad: how to include javascript files

Posted by Daniel Niklas <co...@dniklas.de>.
Hi Matthias,


Matthias Wessendorf-4 wrote:
> 
> On Fri, Aug 15, 2008 at 10:07 AM, Daniel Niklas <co...@dniklas.de> wrote:
> If you want to have it inside Trinidad (I'd not do that),
> you have to register your script file here:
> -CoreCommonScriptsResourceLoader (you need to "patch" it)
> 

I don't like such patches ;-) I don't want to have this inside of trinidad,
but i'am searching for a solution, where the script is automatically
rendered into the response, when a site contains my custom (trinidad-)
component. 



Matthias Wessendorf-4 wrote:
> 
> Otherwise a simple option is the <trh:script />
> or writing a custom resourceLoader.
> 

I think this is important, because the user of my jsf-component mustn't know
anything about wicht internal javascript have to be included in response.
Is this possible with a trinidad resourceLoader or something else in
trinidad?

Daniel 

P.S.: I think writing an own (document-) renderer for this is a "patch", too
;-)
-- 
View this message in context: http://www.nabble.com/Trinidad%3A-how-to-include-javascript-files-tp18942502p18997920.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Trinidad: how to include javascript files

Posted by Matthias Wessendorf <ma...@apache.org>.
On Fri, Aug 15, 2008 at 10:07 AM, Daniel Niklas <co...@dniklas.de> wrote:
>
> Hi,
>
> we have own custom trinidad components. How can i add the needed javascript
> in another way?
>
> Trinidad seems to do this in another way, each component has its own
> javascript-file. This is aggregated to one js-resource an delivered
> automatically without using metaContainer for tr:document or trh:script.
>
> Can you give me a hint how to to this?

If you want to have it inside Trinidad (I'd not do that),
you have to register your script file here:
-CoreCommonScriptsResourceLoader (you need to "patch" it)

Otherwise a simple option is the <trh:script />
or writing a custom resourceLoader.

-Matthias

>
> Best regards
> Daniel
> --
> View this message in context: http://www.nabble.com/Trinidad%3A-how-to-include-javascript-files-tp18942502p18995253.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>



-- 
Matthias Wessendorf

Need JSF and Web 2.0?
http://code.google.com/p/facesgoodies

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org

Re: Trinidad: how to include javascript files

Posted by Daniel Niklas <co...@dniklas.de>.
Hi,

we have own custom trinidad components. How can i add the needed javascript
in another way? 

Trinidad seems to do this in another way, each component has its own
javascript-file. This is aggregated to one js-resource an delivered
automatically without using metaContainer for tr:document or trh:script.

Can you give me a hint how to to this?

Best regards
Daniel
-- 
View this message in context: http://www.nabble.com/Trinidad%3A-how-to-include-javascript-files-tp18942502p18995253.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Re: Trinidad: how to include javascript files

Posted by Matthias Wessendorf <ma...@apache.org>.
or, use the metaContainer facet of <tr:document> to include custom
resource (CSS, JS...)

see an example here:
http://code.google.com/p/facesgoodies/source/browse/trunk/src/main/webapp/WEB-INF/facelets/layout/template.xhtml

-M

On Tue, Aug 12, 2008 at 1:30 PM, Frank Nimphius
<fr...@oracle.com> wrote:
>
> Hi,
>
> look at trh:script
>
> http://myfaces.apache.org/trinidad/trinidad-1_2/trinidad-api/tagdoc/trh_script.html
>
> Frank
>
> Aldo Vadillo Batista wrote:
>
> I have a javascript file that include several validation functions.
> I'm developing an application that uses apache trinidad. When I try to
> include my .js file, the style of the page is not included.
> I mean: it seems like the framework doesn't look for the trinidad skin
> associated to it.
>
> Is there any way to include the .js file?
>
> --
>
> Frank Nimphius | Principal Product Manager
> Oracle Application Development Tools
> Oracle is committed to developing practices and products that help protect
> the environment



-- 
Matthias Wessendorf

Need JSF and Web 2.0?
http://code.google.com/p/facesgoodies

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org