0

We are using Primefaces library for development of JSF components in our application. I need different subviews(subcomponents) to be embedded in primary views(components). For example : I need to embed securityXXX.xhtml in both clientXXX.xhtml and marketXXX.xhtml.securityXXX.xhtml itself contains sub-menus(Example : checkbox,drop-down etc).

securityXXX.xhtml is already embedded in clientXXX.xhtml.Now I need to embed securityXXX.xhtml in marketXXX.xhtml but I need to introduce a new sub-menu in securityXXX.xhtml which is required in case of marketXXX.xhtml but not in clientXXX.xhtml.

Is there any way I can hide/show sub-menus in securityXXX.xhtml and display same in clientXXX.xhtml and marketXXX.xhtml according to my need.Can securityXXX.xhtml be re-usable? I know one of the rendered and visible attributes can be useful for this.Please correct me if I am wrong.I am new to JSF.Please provide me a demonstration/example if possible

Ankit Tripathi
  • 405
  • 4
  • 13
  • Possible duplicate of [How can I show/hide component with JSF?](http://stackoverflow.com/questions/3694450/how-can-i-show-hide-component-with-jsf) – Kukeltje Dec 17 '15 at 07:32
  • I know one of the rendered and visible attributes can be useful for this.Please correct me if I am wrong.I am new to JSF.Please provide me a demonstration/example if possible to show the difference – Ankit Tripathi Dec 17 '15 at 07:47
  • If you know it, why don't you use it? And difference to what? – Kukeltje Dec 17 '15 at 07:48
  • Difference between rendered and visible,I have got some idea over as I am searching through the internet.I am repeating,am very new to JSF.I dont know whether same is applicable in my situation? – Ankit Tripathi Dec 17 '15 at 07:55
  • http://stackoverflow.com/questions/10050669/difference-between-rendered-and-visible-attributes-of-pdialog – Kukeltje Dec 17 '15 at 08:01
  • I have no idea what you're concretely asking, but my educated guess says that you need to focus on how to properly use Facelets, not on the individual JSF/Primefaces components. E.g. ui:define, ui:decorate, etc. Here's a starting point: http://stackoverflow.com/questions/4792862/how-to-include-another-xhtml-in-xhtml-using-jsf-2-0-facelets – BalusC Dec 17 '15 at 08:09

0 Answers0