Rerendering component to use updated value in bean
mpgong Oct 21, 2011 10:31 AMHello,
I was wondering how i can update/re-render a component to use a value from bean that was updated from a selection in a panelmenuitem.
Here is a snippet of what i have.
<h:form>
<h:panelGrid columns="2" columnClasses="panel,panel2" width="100%">
<rich:panel bodyClass="panel-custom-body">
<rich:panelMenu styleClass="panelMenu-custom" itemMode="ajax"
groupMode="ajax" groupExpandedLeftIcon="triangleUp"
groupCollapsedLeftIcon="triangleDown"
topGroupExpandedRightIcon="chevronUp"
topGroupCollapsedRightIcon="chevronDown" itemLeftIcon="disc">
<rich:panelMenuGroup label="Pojects" expanded="true">
<rich:panelMenuItem label="Project 1" name="proj_1"
style="background:#D80000;color:white" />
<rich:panelMenuGroup label="Project 2" name="proj_2" id="p2">
<rich:panelMenuItem label="Total Tasks 145"
name="task1" />
<rich:panelMenuItem label="Complete 125" name="task2" />
<rich:panelMenuItem label="Open 15" name="task3" />
<rich:panelMenuItem label="Invalid 5" name="task4" />
</rich:panelMenuGroup>
<rich:panelMenuItem id="p3" label="Project 3"
name="proj_3" style="background:green;color:white;"
actionListener="#{ProjDetailBean.handleMenuSelectionAction}">
</rich:panelMenuItem>
</rich:panelMenuGroup>
</rich:panelMenu>
</rich:panel>
<rich:panel bodyClass="panel-custom-body">
<rich:panel id="detailsHeader"
header="Project Details for #{ProjDetailBean.detailsTitle}"
styleClass="cp-custom">
</rich:panel>
</rich:panel>
</h:panelGrid>
</h:form>
In the above, i want to select Project 3 and then it updates a bean with the value in ProjDetailBean.detailsTitle to be Project 3. I then want this name to then show up on the panel's header. Initially it is blank. I'm able to set the detailsTitle value in the bean but how do i get the panel to rerender and pull in the value from the bean?
Thanks