-
1. Re: Creating individually loaded widgets
healeyb Sep 8, 2012 9:04 AM (in response to davisonri_k12)I'm struggling to conceptualise exactly what you are trying to do because of the lack of specificity in your question. It sounds a bit
like you've got iteration components within iteration components and the scope for performance problems in this scenario are
significant with JSF. If you can suggest a reduced scope real world version of what you're trying to do I could recommend an
approach that would work.
Regards,
Brendan.
Freelance Java Enterprise Developer
JSF Richfaces Ajax Java 6/7 (scjp) EE 6 HTML CSS JavaScript jQuery MySQL JPA Hibernate Eclipselink
Spring Oracle SQL JPQL Sybase EJB CDI Glassfish Apache JAX-RS Primefaces UNIX Paypal and more..
-
2. Re: Creating individually loaded widgets
davisonri_k12 Sep 9, 2012 1:27 AM (in response to healeyb)dashboard.xhtml
<c:forEach items="${widgets}" var="widget">
<rich:panel id="widgetPanel">
<f:facet name="header">
<h:outputText value="${widget.name}"/>
</f:facet>
<ui:include src="${widget.viewId}"
</rich:panel>
</c:forEach>
and each widget in the list kind of has content like this
widget.xhtml
<rich:dataTable value="#{items}" var="item">
...
...
</rich:dataTable>
I would like for when the dashboard is rendered to first show content of each widget panel (id=widgetPanel) with an please wait gif and and as the content of each widget is completely loaded to replace the please wait with content. And so each panel data is displayed when completely loaded. i have about 10 widgets currently,
-
3. Re: Creating individually loaded widgets
mcmurdosound Sep 9, 2012 4:07 AM (in response to davisonri_k12)I think in this scenario I'd try to use a4j:push or a a4j:poll to check if a widget is fully initialized on the backend and then reRender the part of the page there the content should be. Before that, only a loader animated gif would be visible.
Which version of RF and JSF are you using? Do you use facelets with JSF? In this case the usage of c:if / c:forEach / ui:include with dynamic conditions is legal and they can be rerenderd.
<c:forEach items... var... varStatus="myRowId">
...
<h:panelGroup id="widgetCheck#{myRowId}">
<c:if test="#{widget.ready}">
<ui:include ...
</c:if>
<c:if test="#{!widget.ready}">
... please wait gif-animation ...
</c:if>
</h:panelGroup>
...
</c:forEach>
the push / poll will check if a widget is ready and then will rerender the corresponding h:panelGroup to do the include.