0

I have several questions all related to how to implement a panelgroup within another panelgroup. I have a Main panelgroup which works well without trouble. Within one of its "panels", it contains another panelgroup which we can call a Sub panelgroup, as shown below.

main panel

Problem;Adding the Sub panelgroup "statically" using an absolute path to the "panel" works,but adding the Sub panelgroup "programmatically" it does not show and doesnt throw any error. In otherword, i need to add the Subpanelgroup "programmatically" using

 <ui:include src="#{backingBean.panel}" />

instead of

<ui:include src="/Webpages/file/someWhere/panel.xhtml" />

The obvious reason is because I need to show the other hidden "panels" inside the panelgroup using the backingBean. Moreover, my backingBean has the method init() and setPanel() which all have refused to work inside the html/jsf code.

My backingbean class

@ManagedBean
@SessionScoped
@Named(value = "ganttNavBean")
public class GanttNavigatorBean implements Serializable {

 private String schedule;
 String includedPagex ;
 //private String logoPage = "logoPage.xhtml";

 @PostConstruct
 public void init() {
     schedule = "/testpage.xhtml";
      //  Default include.
 }

 // +getter+setter.

public String getPage() {
    return schedule;
}

public void setPage(String schedule) {
    //VisibilityUtils vutils = new VisibilityUtils(page);
    this.schedule = schedule;
}    
}

What is the best way to get my Sub panel showing?

When do i ever use init(). directly into my html/jsf code?

Is it possible to use setPanel(). in a commandbutton within the Subpanel to change the subpanel contents?(Yes, i know the button will also dissapper, thats what I need).

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Afroid1000
  • 149
  • 10
  • 1
    I personally would not used PanelGrid's for layouts like this. I would use CSS and PrimeFlex. – Melloware Apr 19 '21 at 12:01
  • Does this answer your question? [JSF dynamically include src in "ui:include src="#{bean.pagePath}"](https://stackoverflow.com/questions/20111010/jsf-dynamically-include-src-in-uiinclude-src-bean-pagepath) – Jasper de Vries Apr 19 '21 at 12:35
  • Thanks guys. I have picked two promising solutions from the links you have posted. The first being understanding the difference between view build time and view render time and the second idea is Ajax. I long for a Java Swing OO based approach of building web as i still have not swallowed the html/css/javascript/ajax frog. @BalusC sorry for the shock..am a complete novice punching above my weight...Thanks guys – Afroid1000 Apr 19 '21 at 13:49

0 Answers0