Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Does it make sense for a basic html component to break back & front binding?  RSS feed

 
Michael Grandon
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am very new to JSF, but I do have several years of casual experience. I've never seen something so bizarre in my life.
When I include a basic <input type="file"/> element, my <h:selectBooleanCheckbox onchange="addToList()"/> no longer works.
If I comment out the file input, my selectBooleanCheckbox fires a successful ajax call.
Are these things related in JSF?
 
Tim Holloway
Bartender
Posts: 18713
71
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Michael!

Don't mix raw HTML and JSF input controls in a JSF h:form. It voids the warranty. JSF forms carry additional invisible context data. Use the JSF fileupload tag, instead.

Actually, I don't really recommend mixing raw HTML and JSF elements to begin with. JSF as originally conceived was media-independent, so if for example you put TABLE tags in a View Template and the output renderer was set to "PDF", then you would end up with a PDF document littered with HTML tags in its text.

There's limits to how obsessive I'd be about that. After all, they didn't even have a proper analog to the HTML HEAD and BODY tags until JSF version 2, but as a rule, I prefer h:panelGrid to raw TABLES, and so forth.
 
Michael Grandon
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah. it's a version issue. JSF doesn't support uploads until 2.2
 
Tim Holloway
Bartender
Posts: 18713
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michael Grandon wrote:Yeah. it's a version issue. JSF doesn't support uploads until 2.2


Well, core JSF didn't. Even in JSF1 I was using extension tagsets like RichFaces. It's also how I did AJAX before JSF2.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!