Linked Questions
146 questions linked to/from When to use <ui:include>, tag files, composite components and/or custom components?
0 votes
1 answer
343 views
How to reuse the same view in different projects? [duplicate]
I'm pretty new in JSF usage and yet don't know how to use JSF correctly in some cases. So, The problem: Reusing the same view in a different JSF-projects. I have three completely separated projects (...
0 votes
0 answers
200 views
Avoid prepending id on custom component's inner elements [duplicate]
I am refactoring an existing codebase to use composite components. A lot of the existing logic uses the id on the element. As soon as I extract some html into a custom component and give it an id X, ...
0 votes
1 answer
110 views
Dynamic generation of HTML based on an object type [duplicate]
I'm new to JSF so sorry if my question is trivial. I have to present a list of items of three different types: let's say books, software and courses with different metadata (attributes) and requiring ...
0 votes
0 answers
56 views
Custom Controls in JSF [duplicate]
this question is propably easy to answer, but I really don't know what I should look for in that matter =) I try to explain it. Before I came to classic JSF I worked with a similar technology (based ...
0 votes
0 answers
32 views
Is it possible to pass "props" in JSF custom components? [duplicate]
I recently landed on a project using JavaServer Faces for the FE side, with XHTML pages. There's a lot of duplicated code, and studying this technology I found out that is possible to create custom ...
234 votes
2 answers
296k views
How to include another XHTML in XHTML using JSF 2.0 Facelets?
What is the most correct way to include another XHTML page in an XHTML page? I have been trying different ways, none of them are working.
118 votes
8 answers
59k views
What is the need of JSF, when UI can be achieved with JavaScript libraries such as jQuery and AngularJS
I was reading about JSF that it's a UI framework and provides some UI components. But how is it better or different from number of components that are available from jQueryUI, AngularJS, React, Vue.js,...
47 votes
9 answers
85k views
How to add placeholder attribute to JSF input component?
Shouldn't this line of code render a inputtext field with the placeholder text "fill me" when using html5? <h:inputText placeholder="fill me" /> I do not see any placeholder text. I thought ...
39 votes
4 answers
100k views
How to conditionally render plain HTML elements like <div>s?
I'm trying to implement a composite component which either displays the information details of a user in plain text or displays them through editable input texts fields if the desired details are ...
37 votes
3 answers
48k views
How to ajax-refresh dynamic include content by navigation menu? (JSF SPA)
I'm just learning JSF 2 thanks to this site I had learned a lot in such a short time. My question is regarding how to implement a common layout to all my JSF 2 pages and have only the content part of ...
25 votes
2 answers
55k views
How to create dynamic JSF form fields
I have found some similar questions like this one, however there are so many ways this can be done that it made me more confused. We are getting an XML file that we are reading. This XML contains ...
24 votes
1 answer
33k views
What is the real conceptual difference between ui:decorate and ui:include?
It occurs ago me that ui:decorate is functionally the same as ui:include except that you can also pass ui:param and ui:define to the included file. Am I crazy? EDIT : Although in fact you can pass ...
25 votes
2 answers
18k views
How to make a grid of JSF composite component?
I have lot's of outputLabel and inputText pairs in panelGrids <h:panelGrid columns="2"> <h:outputLabel value="label1" for="inputId1"/> <h:inputText id="inputId1/> <h:...
22 votes
2 answers
10k views
Avoiding duplicate ids when reusing facelets compositions in the same naming container
I have a <ui:composition> that contains a few elements with explicit ids and some ajax events which reference these ids for partial processing/updating. I encapsulated this fragment of xhtml ...
15 votes
1 answer
23k views
How to change head elements of a page when using ui:composition
I want to ask a question that i have a master template like this <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/...