• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Page doesn't submit properly with h:head

 
Tscharner Upjohn
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a commandlink with target="_blank", which when I have just <head></head> at the top of the xhtml page it works fine it will open a new page or new tab, but when I have <h:head></h:head> when I click the link nothing happens on the page. But if I use just <head> I have issues with my templates. Thanks for the help.

 
Greg Charles
Sheriff
Posts: 2993
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of JSF are you using? <h:head> wasn't introduced until JSF 2.0.
 
Tscharner Upjohn
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using JSF 2.1. I also am using icefaces, although not on this page. I only add that in case icfaces adds some information to the head that might be causing issues.

UPDATE--I decided to create a new project this morning and only had a command link and JSF 2.1. I used h:head and h:body. It worked fine. i then added icefaces.jar and it did not work. I am going to look into it further, but here is the first thing I notice. In the one with ICEFaces jar a jsf.js script shows up in the head whereas in the one where it is working fine without icefaces this shows up in the body. What difference might that make?

Non-Working Page Results:


Working page results:


Greg Charles wrote:What version of JSF are you using? <h:head> wasn't introduced until JSF 2.0.
 
Tscharner Upjohn
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After talking in Icefaces forum and working through the javascript it seems to have something to do with icefaces capturing the submit funny so I just moved to richfaces and it works fine now.
 
Tim Holloway
Saloon Keeper
Posts: 18300
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The jsf.js file is the standard included javascript file that gives AJAX support to JSF2. You need one (and only) one copy of it and it should be automatically supplied by your JSF view generator.

Another thing different about JSF2 is the introduction of the h:head tag. JSF components use this element to anchor their custom requirements for content that needs to be added to the HTML head section, such as JS imports, CSS, and so forth. I can state from bitter experience that you MUST use this element in RichFaces 4 or you won't get the skin tags; the vanilla HTML head tag isn't good enough.
 
Tscharner Upjohn
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim,

Thank you for taking the time. Yes, I am using the h:head with richfaces. Everything seems to be working fine. I believe I traced the issue not to the jsf.js file, but to the bridge.js file that Icefaces would implement. I traced it to what seems to be a bug somehow that it doesn't send the entire element ID just the form name after it captures the submit. That is the best I could tell if that helps anyone.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic