JavaScript inclusion does not work
[Logo]
Forums for ICEfaces and ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icefaces.org  [Register] Register  [Login] Login 
JavaScript inclusion does not work  XML
Forum Index -> Components
Author Message
Erol

Joined: 22/12/2006 00:00:00
Messages: 11
Offline


Given an ICEfaces page which contains a JavaScript tag in the HTML head:

...
<head>
<script language="javascript" src="./js/myscript.js"></script>
</head>
...

Assume that the first page that is loaded contains a command link that refers to the page described above using navigation rules. So when clicking on the command link, the page should be loaded. This is indeed the case, but when looking at the HTML source in the browser, the javascript tag is not shown (which means the script has not been loaded). When reloading the page manually, then the script shows up in the header.

This problem also occurrs when:
a) The script is placed within the body (instead the head)
b) The script is surrounded by <f:verbatim>...</f:verbatim> tags (in either the body or the head)
c) The script is additionally surrounded by CDATA tags like suggested in http://www.icefaces.org/JForum/posts/list/651.page

It seems that ICEfaces does NOT include java scripts on pages that are accessed using a navigation rule.

The only fix that we know is that the javascript inclusion has to be placed on each page (even if the page does not require the java script, which is very uggly).

As a side note: we use a panel border layout on each page... however, ICEfaces MUST allow for inclusion of custom JavaScripts on ANY page.

Can someone confirm this bug? Any suggestions or ideas?
philip.breau


Joined: 08/05/2006 00:00:00
Messages: 2627
Offline


Hi,

Yes, this can happen if you aren't using <redirect/>s in your navigation rule. If you don't use a <redirect/> the header won't be loaded for the page you're navigating to. There's two workarounds for this:

1. Use a <redirect/> in your navigation rule.

2. Include the library through JavascriptContext.includeLib(String);

Thanks,
Philip

.
Erol

Joined: 22/12/2006 00:00:00
Messages: 11
Offline


Hi Philip,

Your solution with <redirect/> works fine - that is the one we will use in the future.

Thanks a lot!
robmat


Joined: 06/03/2007 00:00:00
Messages: 8
Offline


Ok, but redirect doesn't work when you have includes in the page...

God damned programmers...
Christian75

Joined: 31/08/2007 00:00:00
Messages: 8
Offline


Hello,

I have similar problem with icefaces 1.6.1 and facelets.
I included a custom component for fck editor.

The only way getting this component working (except the navigation <redirect/> option), was to include the js link for fckeditor.js in every html header.

The JavascriptContext.includeLib method does not work.

Same problem with the stylesheet includes.

Will this problem be fixed?

regards, Christian
tsing

Joined: 19/06/2009 00:00:00
Messages: 1
Offline


@@@@@@@@@@@@
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team