Hello,
i have the follow problem with JSF.
i try to manipulate the component tree of my JSF from a managed-bean action-method.
i can add succefuly an another component to this tree, but i can not remove a old component from this tree.
The System-Output show the right number of gridpanel chlid component before and after removing the a chid component. But i see no change in the Browser (the 3 colums of my panels are allready available).
This is the JSF code
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<f:view>
<h:form id="form" binding="#{foo.form}">
<h:panelGrid columns="3" binding="#{foo.panelGrid}" id="panel">
<h:outputText value="Colum 1" id="t1"/>
<h:outputText value="Colum 2" id="t2"/>
<h:outputText value="Colum 3" id="t3"/>
</h:panelGrid>
<h:commandButton id="button" action="#{foo.doBinding}" value="Binding Example 2" />
</h:form>
</f:view>
</body>
</html>
and this is the code of my managedbean
package test.bean;
import javax.faces.component.html.HtmlForm;
import javax.faces.component.html.HtmlPanelGrid;
public class Foo
{
private HtmlPanelGrid panelGrid;
private HtmlForm form;
public HtmlPanelGrid getPanelGrid() {
return panelGrid;
}
public void setPanelGrid(HtmlPanelGrid panelGrid) {
this.panelGrid = panelGrid;
}
public HtmlForm getForm() {
return form;
}
public void setForm(HtmlForm form) {
this.form = form;
}
public String doBinding()
{
System.out.println(panelGrid.getChildCount());
panelGrid.getChildren().remove(1);
System.out.println(panelGrid.getChildCount());
return "";
}
}
can some body help me?