hello
I want to construct a Dialog in java bean programmatically.
If it is possible, could you give me hint ?
kind regards
Ahmet Temiz
constructing a Dialog in java bean
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Application.createComponent(Dialog.COMPONENT_TYPE);
....
....
- andyba
- Expert Member
- Posts: 2473
- Joined: 31 Mar 2011, 16:27
- Location: Steinfeld, near Bremen/Osnabrück, DE
- Contact:
Don't forget to call the addChild method of the Component you want to add the newly created instance to.
Hint: with the binding attribute, standard to all jsf components including PrimeFaces, you can set the parent Component instance you need in your Bean.
Hint: with the binding attribute, standard to all jsf components including PrimeFaces, you can set the parent Component instance you need in your Bean.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now
hello
again
I tried this but it failed.
Application application = FacesContext.getCurrentInstance().getApplication();
Dialog dialog = (Dialog) application.createComponent(Dialog.COMPONENT_TYPE);
HtmlOutputText text = new HtmlOutputText();
HtmlPanelGrid panel_grid = (HtmlPanelGrid) application.createComponent(HtmlPanelGrid.COMPONENT_TYPE);
List pangrid_children = panel_grid.getChildren();
pangrid_children.clear();
panel_grid.setColumns(1);
panel_grid.setId("Panelgrid");
pangrid_children.add(text);
dialog.getChildren().add(panel_grid);
what did I do wrong
kind regards
again
I tried this but it failed.
Application application = FacesContext.getCurrentInstance().getApplication();
Dialog dialog = (Dialog) application.createComponent(Dialog.COMPONENT_TYPE);
HtmlOutputText text = new HtmlOutputText();
HtmlPanelGrid panel_grid = (HtmlPanelGrid) application.createComponent(HtmlPanelGrid.COMPONENT_TYPE);
List pangrid_children = panel_grid.getChildren();
pangrid_children.clear();
panel_grid.setColumns(1);
panel_grid.setId("Panelgrid");
pangrid_children.add(text);
dialog.getChildren().add(panel_grid);
what did I do wrong
kind regards
as andyba already mentioned:
Which means, you have to have a container in your page and you need to add the dialog as a child of this container inside of your beanDon't forget to call the addChild method of the Component you want to add the newly created instance to.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 2 guests