Bonjour à tous,

J'aimerais savoir s'il est possible de déclarer dynamiquement l'include pour une modalPanel, suite au clic d'un lien.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 
<a4j:outputPanel id="panelGlobal">
  <h:form>	
    <div>
      <a4j:outputPanel id="panelBouton">
        <a4j:commandLink immediate="true" action="#{controller.action}" reRender="panelActions,panelInclude">
          <span>Bouton</span>
        </a4j:commandLink>
 
        <div id="actionsId" style="display: none;">
          <a4j:outputPanel id="panelActions">
            <a4j:repeat value="#{controller.liste}" var="actionListe">
              <a4j:commandLink ajaxSingle="true" immediate="true" action="#{controller.action2}" oncomplete="Richfaces.showModalPanel('#{actionListe.nomModal}'); gererAffichageDiv('actionsId')">
                <span>#{actionListe.libelle}</span>
              </a4j:commandLink>
            </a4j:repeat>
          </a4j:outputPanel>
        </div>
      </a4j:outputPanel>
    </div>
  </h:form>
 
  <a4j:outputPanel id="panelInclude" rendered="#{not empty controller.liste}">
    <a4j:repeat value="#{controller.liste}" var="actionListe">
      <ui:include id="#{actionListe.nomModal}" src="#{actionListe.pathModal}" />
    </a4j:repeat>
  </a4j:outputPanel>
 
</a4j:outputPanel>