I think the getter is called once on tree creation and the setter is
called each request.
Instead of the getter, restoreState will be called for the 2nd and
following requests to recreate the component.

This is all speculation -- I don't know if it's true.

On 9/12/06, Leyzerzon, Simeon <[EMAIL PROTECTED]> wrote:



Hi,

Could someone explain this behavior please:

I have an html panel grid bound to a backing bean property and populated
dynamically.  It seems that it only works once, all the subsequent times,
the grid's getter in the backing bean (getPanelGrid() method below) is
bypassed and the state of all the children's of the grid doesn't get
changed.  Why is that?

Here are the relevant code snippets:

<h:panelGrid footerClass="subtitle" headerClass="" styleClass=""
        columnClasses="" binding="#{selector.panelGrid}">

   public HtmlPanelGrid getPanelGrid() {

        System.out.println(">>>>>>>Inside the getPanelGrid().....");
        panelGrid = new HtmlPanelGrid();
        panelGrid.setColumns(4);
        panelGrid.setBgcolor("red");

        HtmlSelectOneMenu chooser = new HtmlSelectOneMenu();
        chooser.setId("reportsOfCategory");
        chooser.setOnchange("submit()");
        chooser.setValue("${selector.reportName}");
        chooser.setValueChangeListener(application.createMethodBinding(
                "#{selector.buildControls}",
                new Class[] { ValueChangeEvent.class }));
        chooser.setTitle("Please select a report to run");
        ValueBinding chooserBinding =
application.createValueBinding("#{selector.chooserBinding}");
        System.out.println("Value binding for the chooser is set to: " +
chooserBinding);
        chooser.setValueBinding("value",chooserBinding);
        chooser.getChildren().add(
                ReportsPerCategoryMapper.getOptionItems(this.getCategory()
                        .getName()));

        panelGrid.getChildren().add(chooser);
        // this is only for testing
        panelGrid.getChildren().add(displayCategory());
        return panelGrid;
    }


Thanks for the answers,

Simeon Leyzerzon

==============================================================================
Please access the attached hyperlink for an important electronic
communications disclaimer:

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================




Reply via email to