I am working on building a dashboard, and its gadgets are some links to different pages that I want to show inside iframes. I have a button to add a new gadget to the dashboard, and after adding a new one, I refresh the dashboard. For the 3 first gadgets, there is no problem in the application, and it works perfectly. However, when I want to add the 4th gadget, the ajax call is not working and the page starts to reload again. After reloading the page, I can add a new gadget again and it works, but the next time it stops working again, and it refreshes the page. I cannot understand what the problem is. BTW, when I remove iframes and I print the links themselves, the program works without any problem. Here is my code :
<h:panelGrid columns="2" >
<p:outputLabel value="${msg.dashboard_dashboard}" />
<p:selectOneMenu value="#{dashboardDashletsManager.dashboard}" style="min-width: 200px" converter="#{dashboardConverter}" filter="true" filterMatchMode="contains" >
<f:selectItems value="#{dashboardDashletsManager.dashboards}" var="item" itemLabel="#{item.description}" itemValue="#{item.value}" />
<p:ajax update=":form" />
</p:selectOneMenu>
<p:outputLabel for="dashlet" value="${msg.dashboard_dashlet}" />
<p:selectOneMenu id="dashlet" value="#{dashboardDashletsManager.globalDashletToAdd}" style="min-width: 200px" converter="#{serviceProviderConverter}" filter="true" filterMatchMode="contains">
<f:selectItems value="#{dashletsController.globalDashlets}" var="provider" itemLabel="#{provider.description}" itemValue="#{provider}" />
</p:selectOneMenu>
<p:commandButton value="${msg.dashboard_add}" icon="ui-icon-plus" ajax="true" update=":form:dashboardPanel" process="dashlet @this" actionListener="#{dashboardDashletsManager.addToDashboard}" />
</h:panelGrid>
<p:outputPanel id="dashboardPanel">
<ui:repeat value="#{dashboardDashletsManager.dashlets}" var="dashlet">
<object width="400" height="400" type="text/html" data="#{dashlet.restUrl}"></object>
</ui:repeat>
</p:outputPanel>