1 Reply Latest reply on Apr 25, 2008 1:09 PM by Marcelo Leiras

    Resize modalPanel dynamically

    Marcelo Leiras Newbie

      Hi,

      i wanna show a modalPanel wen a small picture is clicked. This modalPanel must contain the picture enlarged. Take a look at my code:

      <rich:modalPanel id="mpFoto" width="#{rastreador.larguraModalPanelFoto}" height="#{rastreador.alturaModalPanelFoto}" >
      <h:form>
      
      <rich:spacer height="10px" />
      <rich:panel style="text-align:center;margin-left: auto;margin-right: auto; border-width: 0px 0px 0px 0px;" >
      <a4j:outputPanel style="text-align:center;margin-left: auto;margin-right: auto;" ajaxRendered="true" rendered="true">
      
      <rich:panel style="text-align:center;margin-left: auto;margin-right: auto; border-width: 0px 0px 0px 0px;" >
      <h:graphicImage id="giFoto" url="#{rastreador.nomeFotoCorrente}" height="#{rastreador.alturaFotoCorrente}" width="#{rastreador.larguraFotoCorrente}"/>
      </rich:panel>
      
      </a4j:outputPanel>
      </rich:panel>
      
      <rich:spacer height="10px" />
      
      <h:panelGrid columns="2" style="text-align:center;margin: auto auto auto auto;">
      <a4j:commandButton limitToList="true" oncomplete="javascript:Richfaces.hideModalPanel('mpFoto')" value="Fechar" styleClass="button"/>
      </h:panelGrid>
      
      </h:form>
      </rich:modalPanel>
      


      The problem is that the width and height of modalPanel must change according the dimensions of the picture. My actual code is not working like i want. Am i doing something wrong? Thanks a lot.