0 Replies Latest reply on Apr 30, 2008 1:07 PM by Marcelo Leiras

    Dynamic simple content inside modal panel

    Marcelo Leiras Newbie

      Hi,

      i'm trying to put a simple HtmlOutputText dynamically inside a modal panel. Please take a look at my code:

      JSP:

      <rich:modalPanel id="mpProtocoloSanitario" autosized="true" >
      <h:form>
      <rich:panel style="height: 30px; width: 200px; background-color: #0000FF;" >
      <h:outputText value="Test"/>
      </rich:panel>
      
      <rich:panel id="pnProtocoloSanitario" binding="#{rastreador.panelProtocoloSanitario}" />
      
      <rich:panel style="text-align:center;margin-left: auto;margin-right: auto; margin-top: auto; margin-bottom: auto; border-width: 0px 0px 0px 0px; height: 30px;background-color: transparent;" >
      <h:graphicImage url="/imagens/bt_fechar.png" style="cursor: hand; cursor: pointer; margin-top: 10px;" onclick="javascript:Richfaces.hideModalPanel('mpProtocoloSanitario')" />
      </rich:panel>
      </h:form>
      </rich:modalPanel>
      


      JAVA:

      private void updatePanel(HtmlPanel panel) {
       if (panel == null) {
       panel = new HtmlPanel();
       } else {
       panel.getChildren().clear();
       }
      
       HtmlOutputText ot = new HtmlOutputText();
       ot.setRendered(true);
       ot.setId("otTest");
       ot.setValue("Test Modal Panel");
      
       panel.getChildren().add(ot);
      }
      


      The method "updatePanel" is called after a click on a button.
      I have an attribute private HtmlPanel panelProtocoloSanitario; at my bean, with get and set.
      The modal panel opens, but the "HtmlOutputText ot" is not displayed. What i am doing wrong? Thanks for the help.