reRender not working using binding
niels-dee Apr 23, 2007 6:13 AMI'm having some trouble re rendering a part of an outputPanel, i want to display some different form elements depending on the status of an order. I wrote the following code in my bean:
@Stateless @Scope(ScopeType.EVENT) @Name("alertDetails") .. @Out(value="alertDetailsHtmlPanelGrid",scope=ScopeType.EVENT,required=false) private HtmlAjaxOutputPanel htmlPanelGrid = null; @Factory("alertDetailsHtmlPanelGrid") public void refresh(){ log.info("Preparing"); app = FacesContext.getCurrentInstance().getApplication(); htmlPanelGrid = (HtmlAjaxOutputPanel) app.createComponent(HtmlAjaxOutputPanel.COMPONENT_TYPE); log.info("Generating HtmlPanelGrid using ows : "+orderWorkflowStatusId); HtmlOutputText text; text = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE); text.setValue("You are looking at alert : "+orderWorkflowStatusId); htmlPanelGrid.getChildren().add(text); text = (HtmlOutputText) app.createComponent(HtmlOutputText.COMPONENT_TYPE); Random generator = new Random(); text.setValue("Random value : "+generator.nextInt()); htmlPanelGrid.getChildren().add(text); log.info("done building HtmlPanelGrid , no of children : "+htmlPanelGrid.getChildCount()); }
In my view i have commandButton which is in a rich treenode
<a:commandLink reRender="alertDetailsPanel" value="#{item.description}"> <f:param value="#{item.id}" name="orderWorkflowStatusId"/> </a:commandLink>
The alertDetailsPanel is defined as :
<a:outputPanel id="alertDetailsPanel" > <a:outputPanel binding="#{alertDetailsHtmlPanelGrid}"/> <br/> <h:outputText value="#{alertDetails.random}"/> </a:outputPanel>
The jboss log tells me the refresh() method is called when i press the link.
12:03:46,433 INFO [AlertDetailsBean] Preparing 12:03:46,435 INFO [AlertDetailsBean] Generating HtmlPanelGrid using ows : 2288045 12:03:46,435 INFO [AlertDetailsBean] done building HtmlPanelGrid , no of children : 2
When i look at the a4j log i don't see any changes in the binding values, but the random value has changed.
<span id="alertDetailsPanel"><span id="_id73">You are looking at alert : nullRandom value : 1334727162</span><br /> 196772874</span>
The contents of the panel with the binding do not change, it does render when i load the page.
Is this a bug or is there something i am doing wrong ?