title: Cannot 'hide' rich:fileUpload
body: <p>Im trying to create a page that uses the rich:fileUpload, to (surprisingly) upload an image, once the upload is completed I want to 'hide' the rich:fileUpload component and display the jQuery plugin jCrop so that the image can be cropped before saving. once the image is saved from the crop selected, the two components should toggle their viewability again.</p>
  
  <p>However, I dont appear to be able to get the rich:fileUpload to 'hide'. the jCrop component displays fine, as does the jCrop functionality. but no matter what I try rich:fileUpload is still displayed on the screen. Actually if I add <code>rendered="#{!uploadAndCrop.newImage}" </code>to the rich:panel that the rich:fileUpload is in, nothing seems to update. I have to remove this for the jCrop component to appear.</p>
  
  <p>My code is below, it is a little messy as ive tried so many different things. Would be extremely grateful if someone could point me in the right direction with this, or advise a better way of doing it.</p>
  
  <p>Thanks</p>
  
  <p><code></p>
  
  <p>
  </p>
  
  <pre><code>&lt;ui:define name="head"&gt;
      &lt;link href="stylesheet/jquery.Jcrop.css" rel="stylesheet"
          type="text/css" /&gt;
  
      &lt;script type="text/javascript" src="scripts/jquery-1.4.4.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="scripts/jquery.Jcrop.js"&gt;&lt;/script&gt;
  
      &lt;script language="Javascript"&gt;// &lt;![CDATA[ //
       {      
          var $J = jQuery.noConflict();
       }
      //]]&gt; //&lt;/script&gt;
  
  
  &lt;/ui:define&gt;
  
  &lt;ui:define name="body"&gt;
      &lt;h:form&gt;
          &lt;h:panelGrid columns="2" columnClasses="top,top"&gt;
  
              &lt;h:panelGroup id="uploadgroup"&gt;
                  &lt;a4j:outputPanel id="uploadpanel"&gt;
                      &lt;rich:panel rendered="#{!uploadAndCrop.newImage}"&gt;
                          &lt;rich:fileUpload fileUploadListener="#{uploadAndCrop.listener}"
                              maxFilesQuantity="#{uploadAndCrop.uploadsAvailable}" id="upload"
                              immediateUpload="#{uploadAndCrop.autoUpload}"
                              acceptedTypes="jpg, gif, png, bmp"
                              allowFlash="#{uploadAndCrop.useFlash}" listHeight="80px"&gt;
                              &lt;ui:remove&gt;
                                  onfileuploadcomplete="Richfaces.showModalPanel('croppanel');"&gt;
                              &lt;/ui:remove&gt;
                              &lt;a4j:support event="onuploadcomplete"
                                  reRender="info, uploadgroup, cropgroup" /&gt;
                          &lt;/rich:fileUpload&gt;
                          &lt;h:outputText value="#{uploadAndCrop.newImage}" id="newimage" /&gt;
                          &lt;a onclick="Richfaces.showModalPanel('croppanel');" href="#"&gt;Show
                          ModalPanel&lt;/a&gt;
                      &lt;/rich:panel&gt;
                  &lt;/a4j:outputPanel&gt;
              &lt;/h:panelGroup&gt;
  
  
  
              &lt;h:panelGroup id="info"&gt;
                  &lt;rich:panel bodyClass="info" rendered="#{!uploadAndCrop.newImage}"&gt;
                      &lt;f:facet name="header"&gt;
                          &lt;h:outputText value="Uploaded Image Preview" /&gt;
                      &lt;/f:facet&gt;
  
                      &lt;rich:dataGrid columns="1" value="#{uploadAndCrop.files}"
                          var="file" rowKeyVar="row"&gt;
                          &lt;rich:panel bodyClass="rich-laguna-panel-no-header"&gt;
                              &lt;h:panelGrid columns="2"&gt;
                                  &lt;a4j:mediaOutput element="img" mimeType="#{file.mime}"
                                      createContent="#{uploadAndCrop.paint}" value="#{row}"
                                      style="width:156x; height:71px;" cacheable="false"&gt;
                                      &lt;f:param value="#{uploadAndCrop.timeStamp}" name="time" /&gt;
                                      &lt;s:conversationId /&gt;
                                  &lt;/a4j:mediaOutput&gt;
  
                              &lt;/h:panelGrid&gt;
                          &lt;/rich:panel&gt;
                      &lt;/rich:dataGrid&gt;
                  &lt;/rich:panel&gt;
                  &lt;rich:spacer height="3" /&gt;
                  &lt;br /&gt;
                  &lt;a4j:commandButton action="#{uploadAndCrop.clearUploadData}"
                      reRender="info, upload" value="Clear Uploaded Image" /&gt;
              &lt;/h:panelGroup&gt;
  
  
              &lt;h:panelGroup id="cropgroup"&gt;
                  &lt;rich:panel rendered="#{uploadAndCrop.newImage}"&gt;
                      &lt;f:facet name="header"&gt;
                          &lt;h:outputText value="Crop Image" /&gt;
                      &lt;/f:facet&gt;
                      &lt;a4j:outputPanel id="crop" layout="inline"&gt;
                          &lt;rich:jQuery selector="#cropbox" timing="immediate"
                              query="Jcrop()" /&gt;
                          &lt;a4j:mediaOutput element="img"
                              mimeType="#{uploadAndCrop.tempImageStore.mime}" id="cropbox"
                              createContent="#{uploadAndCrop.paintCrop}" value="null"
                              style="width:312; height:142px;" cacheable="false"&gt;
                              &lt;f:param value="#{uploadAndCrop.timeStamp}" name="time" /&gt;
                              &lt;s:conversationId /&gt;
                          &lt;/a4j:mediaOutput&gt;
                          &lt;rich:spacer height="3" /&gt;
                          &lt;br /&gt;
                          &lt;a4j:commandButton action="#{uploadAndCrop.clearUploadData}"
                              reRender="info, upload" value="Crop" /&gt;
                      &lt;/a4j:outputPanel&gt;
                  &lt;/rich:panel&gt;
              &lt;/h:panelGroup&gt;
  
  
          &lt;/h:panelGrid&gt;
  
          &lt;h:commandButton id="save" value="Save"
              action="#{uploadAndCrop.save}"&gt;
              &lt;f:param name="cmsCompanyIdCom" value="" /&gt;
          &lt;/h:commandButton&gt;
          &lt;s:button id="cancelEdit" value="Cancel" propagation="end"
              view="/CmsCompany.xhtml"&gt;
              &lt;f:param name="cmsCompanyIdCom" value="" /&gt;
          &lt;/s:button&gt;
      &lt;/h:form&gt;
  
      &lt;ui:remove&gt;
          &lt;rich:modalPanel id="croppanel" width="350" height="240"&gt;
              &lt;f:facet name="header"&gt;
                  &lt;h:panelGroup&gt;
                      &lt;h:outputText value="Crop Image"&gt;&lt;/h:outputText&gt;
                  &lt;/h:panelGroup&gt;
              &lt;/f:facet&gt;
              &lt;f:facet name="image"&gt;
                  &lt;ui:remove&gt;
                      &lt;h:panelGroup&gt;
                          &lt;h:outputText value="close" /&gt;
                          &lt;rich:componentControl for="croppanel" attachTo="close"
                              operation="hide" event="onclick" /&gt;
                      &lt;/h:panelGroup&gt;
                  &lt;/ui:remove&gt;
              &lt;/f:facet&gt;
  
              &lt;rich:panel rendered="#{uploadAndCrop.newImage}"&gt;
                  &lt;ui:remove&gt;
                      &lt;f:facet name="header"&gt;
                          &lt;h:outputText value="Crop Image" /&gt;
                      &lt;/f:facet&gt;
                  &lt;/ui:remove&gt;
                  &lt;a4j:outputPanel id="crop" layout="inline"&gt;
  
                      &lt;a4j:mediaOutput element="img"
                          mimeType="#{uploadAndCrop.tempImageStore.mime}" id="cropbox"
                          createContent="#{uploadAndCrop.paintCrop}" value="null"
                          style="width:312; height:142px;" cacheable="false"&gt;
                          &lt;f:param value="#{uploadAndCrop.timeStamp}" name="time" /&gt;
                          &lt;s:conversationId /&gt;
                      &lt;/a4j:mediaOutput&gt;
  
  
                      &lt;ui:remove&gt;
                          &lt;rich:spacer height="3" /&gt;
                          &lt;br /&gt;
                          &lt;a4j:commandButton action="#{uploadAndCrop.clearUploadData}"
                              reRender="info, upload" value="Crop" /&gt;
                      &lt;/ui:remove&gt;
                  &lt;/a4j:outputPanel&gt;
              &lt;/rich:panel&gt;
  
              &lt;a onclick="Richfaces.hideModalPanel('croppanel');" href="#"&gt;Hide
              ModalPanel&lt;/a&gt;
          &lt;/rich:modalPanel&gt;
      &lt;/ui:remove&gt;
  
  &lt;/ui:define&gt;
  </code></pre>
  
  <p>
  </code></p>