Richfaces modalpanel load with Ajax

I use richfaces in my project and especially the rich: modalPanel tag, which allows me to display pop-ups on pages.

To do this, I enable my popup as follows:

<ui:include src="popup.xhtml" />

This popup contains this code:

<rich:modalPanel id="sra" width="400" autosized="true" left="100" >
...
</rich:modalPanel>

Finally, to display the popup, I do this on the main page:

<a4j:commandLink id="linkSRA" value="#{msg['SRA']}" action="#{controller.checkSRA}" oncomplete="#{rich:component('sra')}.show()" />

Everything is working fine, but my problem is this:

I have many pop-ups on the page, and each pop-up is included in the main page. The weight of this is very big for nothing. So how do I do to load popup content in ajax when I want to load popup?

thank

+3
source share
2 answers

- , modal oncomplete = ".."

+2

: " Richfaces, , . :

<a4j:outputPanel binding="#{popupController.popupContainer}" id="popupContainer">
<c:forEach items="#{popupController.popups}" var="popup">
<f:subview id="popupView#{popup.id}">
<ui:include src="#{popup.uri}">
<ui:param name="popupBean" value="#{popup.popupBean}"/>
</ui:include>
</f:subview>
</c:forEach>
</a4j:outputPanel> 

. , , .

0

Source: https://habr.com/ru/post/1794174/


All Articles