here is my code:
<h:selectOneMenu value="#{statistic.currentChoice}"
onchange="submit()"
valueChangeListener="#{statistic.changedCurrentChoice}"
id="statistic_type">
<f:selectItems value="#{statistic.statisticChoices}" />
</h:selectOneMenu>
When I select an item once the form is submitted and the page is refreshed twice. So far so good. If I further reselect another item in the select menu, the page this time is refreshed 4 times and causes the error:
Component ID nav_panel-nav_item0 has already been found in the view
to be thrown. The nav_panel-nav_item0 ID comes from another header.xhtml
file
<h:form id="nav" styleClass="nav" rendered="#{data.showMenu}">
<t:panelNavigation2 id="panel-nav" expandAll="true">
<t:navigationMenuItems value="#{data.menuItems}" />
</t:panelNavigation2>
</h:form>
which is included in the XHTML file with the select menus as follows:
<ui:composition template="header.xhtml"
To know how often the page is refreshed, I use system.out.print
within the getMenuItems()
method of data.
Why does the page get refreshed so often? or Why is the duplicate ID error being thrown.