On 7/1/09 3:51 AM, webtier_at_javadesktop.org wrote:
> If I add components to an existing panelGroup in a facelet, these components will be rendered correctly on the client. Now, if I modify a value in one of these programmatically added components, the changes will not be applied after postback when using the default JSF2 viewhandler. However, switching to the legacy facelets 1.1.14 viewhandler, changes are applied.
>
> It appears as the restored view only contains the facelets view without the programmatically added components. The problem can be seen in the following example. Is this a bug or am I doing something wrong?
>
If you can create a simple test case and attach it to an issue [1] we
can take a look.
[1]
https://javaserverfaces.dev.java.net/issues/
> [code]
> <h:form id="form">
> <h:panelGroup id="viewPanel">
> <!-- dynamic created components are added here. -->
> </h:panelGroup>
> <h:commandButton id="render" value="render" action="#{render.render}"/>
> </h:form>
> [/code]
>
> [code]
> public class RenderBean {
>
> private String value;
>
> public RenderBean() {
> value = "foo";
> }
>
> public String getValue() {
> return value;
> }
>
> public void setValue(String value) {
> this.value = value;
> }
>
> public void render() {
>
> //<h:form id="form">
> //<h:panelGroup id="viewPanel"/>
> //</h:form>
>
> UIComponent viewPanel = FacesContext
> .getCurrentInstance()
> .getViewRoot()
> .findComponent("form:viewPanel");
>
> viewPanel.getChildren().clear();
>
> UIComponent childPanel = new HtmlPanelGroup();
> childPanel.setId("childPanel");
> viewPanel.getChildren().add(childPanel);
>
> // Add a textinput to the inner most panel with a
> // binding to the the value property of this bean.
> // ...
> //<h:panelGroup id="viewPanel">
> //<h:panelGroup id="childPanel"/>
> //<h:textInput value="#{render.value}"/>
> //</h:panelGroup>
> //</h:panelGroup>
> // ...
>
> UIComponent textInput = new HtmlInputText();
> textInput.setId("textInput");
> textInput.setValueExpression("value", FacesContext.getCurrentInstance()
> .getApplication().getExpressionFactory().createValueExpression(
> FacesContext.getCurrentInstance().getELContext(),
> "#{render.value}", Object.class));
>
> childPanel.getChildren().add(textInput);
> }
> }
> [/code]
> [Message sent by forum member 'janderssn' (janderssn)]
>
> http://forums.java.net/jive/thread.jspa?messageID=353741
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>