New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to supress jsf.js after combining JS files #35

Closed
smasala opened this Issue May 27, 2014 · 8 comments

Comments

Projects
None yet
2 participants
@smasala

smasala commented May 27, 2014

When using Omnifaces CombineResourceManager and setting the myFaces JSF script target to head

    <h:outputScript library="javax.faces" name="jsf.js" target="head" />

Omnifaces catches and combines the script correctly, however, the jsf.js script tag is then inserted a second time at the end of the body.

    <script type="text/javascript" src="/xxxxx/javax.faces.resource/jsf.js.faces?ln=javax.faces"><!--

    //--></script>

By removing the target - Omnifaces no longer combines the JS script and the jsf.js file is only inserted once.

Is this a Omnifaces or myFaces issue?

Setup:
Tomcat 7.0.50
Richfaces 4.3.1
MyFaces 2.1.12
JSF 2.0

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC May 27, 2014

Member

Roger. Reproduced and fixed. Try the current 1.8 snapshot and let me know.
https://oss.sonatype.org/content/repositories/snapshots/org/omnifaces/omnifaces/1.8-SNAPSHOT/

Member

BalusC commented May 27, 2014

Roger. Reproduced and fixed. Try the current 1.8 snapshot and let me know.
https://oss.sonatype.org/content/repositories/snapshots/org/omnifaces/omnifaces/1.8-SNAPSHOT/

@smasala

This comment has been minimized.

Show comment
Hide comment
@smasala

smasala May 28, 2014

Fantastic, it works! thanks

smasala commented May 28, 2014

Fantastic, it works! thanks

@smasala smasala closed this May 28, 2014

BalusC added a commit that referenced this issue May 30, 2014

@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC May 30, 2014

Member

Sorry, it broke including "hardcoded" JS resources (on among others zeef.com). I will re-investigate this issue later.

Member

BalusC commented May 30, 2014

Sorry, it broke including "hardcoded" JS resources (on among others zeef.com). I will re-investigate this issue later.

@BalusC BalusC reopened this May 30, 2014

@smasala

This comment has been minimized.

Show comment
Hide comment
@smasala

smasala May 30, 2014

With the snapshot you provided: The following CSS files are not suppressed:

<h:outputStylesheet library="oam.custom.calendar.WH" name="theme.css" />
<h:outputStylesheet library="oam.custom.calendar.DB" name="theme.css" />

And also the auto inserted JS resource:

<script type="text/javascript" src="/xxxxx/javax.faces.resource/inputTextHelp.js.xhtml?ln=oam.custom.inputTextHelp">

smasala commented May 30, 2014

With the snapshot you provided: The following CSS files are not suppressed:

<h:outputStylesheet library="oam.custom.calendar.WH" name="theme.css" />
<h:outputStylesheet library="oam.custom.calendar.DB" name="theme.css" />

And also the auto inserted JS resource:

<script type="text/javascript" src="/xxxxx/javax.faces.resource/inputTextHelp.js.xhtml?ln=oam.custom.inputTextHelp">
@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC May 30, 2014

Member

I committed a fix, also for CSS. Can you please try today's snapshot? https://oss.sonatype.org/content/repositories/snapshots/org/omnifaces/omnifaces/1.8-SNAPSHOT/

Member

BalusC commented May 30, 2014

I committed a fix, also for CSS. Can you please try today's snapshot? https://oss.sonatype.org/content/repositories/snapshots/org/omnifaces/omnifaces/1.8-SNAPSHOT/

@smasala

This comment has been minimized.

Show comment
Hide comment
@smasala

smasala Jun 2, 2014

CSS files are all combined. Great, thanks!

However, the inputTextHelp files from myfaces is still auto inserted for some reason. What's also strange is that it isn't combined either. Usually both happen when something goes wrong, they are combined and inserted a second time... however, this isn't the case this time.

<script type="text/javascript" src="/xxxxx/javax.faces.resource/inputTextHelp.js.xhtml?ln=oam.custom.inputTextHelp"><!--
//--></script>

smasala commented Jun 2, 2014

CSS files are all combined. Great, thanks!

However, the inputTextHelp files from myfaces is still auto inserted for some reason. What's also strange is that it isn't combined either. Usually both happen when something goes wrong, they are combined and inserted a second time... however, this isn't the case this time.

<script type="text/javascript" src="/xxxxx/javax.faces.resource/inputTextHelp.js.xhtml?ln=oam.custom.inputTextHelp"><!--
//--></script>
@BalusC

This comment has been minimized.

Show comment
Hide comment
@BalusC

BalusC Jun 2, 2014

Member

That may happen if the resource isn't added as a true JSF resource via @ResourceDependency annotation or UIViewRoot#addComponentResource() programmatic call, but is instead "hardcoded" in the renderer. In such case there's nothing what the CombinedResourceHandler can do. Basically, Tomahawk guys need to rewrite their components conform JSF 2.x instead of sticking to old JSF 1.x approach.

Member

BalusC commented Jun 2, 2014

That may happen if the resource isn't added as a true JSF resource via @ResourceDependency annotation or UIViewRoot#addComponentResource() programmatic call, but is instead "hardcoded" in the renderer. In such case there's nothing what the CombinedResourceHandler can do. Basically, Tomahawk guys need to rewrite their components conform JSF 2.x instead of sticking to old JSF 1.x approach.

@smasala

This comment has been minimized.

Show comment
Hide comment
@smasala

smasala Jun 2, 2014

Typical 👍 Other than that it works like a dream :) Thanks

smasala commented Jun 2, 2014

Typical 👍 Other than that it works like a dream :) Thanks

@smasala smasala closed this Jun 2, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment