-1

I'm new to JSF - I need to implement a generic panel that, based on clicking on btn1 or btn2 shows panel1 or panel2. What is the best way to do this?

Edit

One of the things I want to do is encapsulate some logic within each implementation of the generic component - I don't know if composites are the best way to achieve it, even though I know I can pass values/methods into the composite via attributes

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
nuno
  • 1,771
  • 1
  • 19
  • 48
  • 4
    The best way is to actually learn the basics of JSF first. What have you tried so far? – Gimby Jul 24 '14 at 12:15
  • I've been studying composites but it feels like stretching a long way to do something simple. One of the things I want to do is encapsulate some logic within each implementation of the generic component - I don't know if composites are the best way to achieve it, even though I know I can pass values/methods into the composite via attributes. – nuno Jul 24 '14 at 13:08
  • Composites are very much not the basics. Do you know how to create a simple page with two buttons and clicking on either button updates what is shown on screen? – Gimby Jul 24 '14 at 13:13
  • Yes, the page is created, the buttons are there. Now I want to do this ; on btn1 I want to instantiante genericPanel as PanelA; on btn2, PanelB, and so on. I am aware that I can simply place 2 panels and , but I just wanted to know if there is a better way. – nuno Jul 24 '14 at 13:36
  • 1
    Still no decent example (http://sscce.org/), only a vague high level description. Unanswerable at this point in my opinion. A composite component -might- do it, but it would all depend on what is rendered inside PanelA and PanelB and what kind of backing beans are involved. Perhaps a simple ui:include can also work. I cannot know, you provide nothing that might help to narrow it down. – Gimby Jul 24 '14 at 14:15

1 Answers1

0

Going to stick with for now <ui:include> - seems simpler.

nuno
  • 1,771
  • 1
  • 19
  • 48