aspose file tools*
The moose likes JSF and the fly likes Page doesn't submit properly with h:head Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Page doesn Watch "Page doesn New topic
Author

Page doesn't submit properly with h:head

Tscharner Upjohn
Greenhorn

Joined: Jul 13, 2012
Posts: 7
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

Joined: Oct 01, 2001
Posts: 2864
    
  11

What version of JSF are you using? <h:head> wasn't introduced until JSF 2.0.
Tscharner Upjohn
Greenhorn

Joined: Jul 13, 2012
Posts: 7
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

Joined: Jul 13, 2012
Posts: 7
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

Joined: Jun 25, 2001
Posts: 16305
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Tscharner Upjohn
Greenhorn

Joined: Jul 13, 2012
Posts: 7
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Page doesn't submit properly with h:head