7 Replies Latest reply on Sep 14, 2009 3:10 PM by nbelaevski

    FileUpload rerender

    frer

      Hi,

      I'm trying to use the fileUpload to upload an image. When the user selects the image from the fileUpload, I want the file to start immediately to be uploaded. On completion, I want the fileUpload to be hidden and the image to appear (using a graphicImage) with a link to remove it (using a commandlink). The user can then use the remove image button to remove it and then the fileUpload would appear again.

      Here is my code:

      <s:div id="item-image-value-container">
       <rich:fileUpload id="item-image-value-upload"
       fileUploadListener="#{formAction.uploadImage}"
       maxFilesQuantity="1"
       immediateUpload="true"
       acceptedTypes="jpg, gif, png, bmp"
       addControlLabel="#{messages['org.mdarad.framework.resources.list.add']} Image"
       cancelEntryControlLabel="#{messages['org.mdarad.framework.resources.list.remove']} Image"
       rendered="#{formAction.entity.image == null}">
       <a4j:support event="onuploadcomplete" reRender="item-image-value-container" />
       </rich:fileUpload>
       <h:panelGrid columns="2" rendered="#{formAction.entity.image != null}">
       <s:graphicImage id="item-image-value-preview" value="#{formAction.entity.image.content}" style="width:48px"/>
       <a4j:commandLink id="item-image-value-remove"
       action="#{formAction.clearImage}"
       value="#{messages['org.mdarad.framework.resources.list.remove']} Image"
       reRender="item-image-value-container"/>
       </h:panelGrid>
       </s:div>


       public void uploadImage(UploadEvent event) throws Exception {
       UploadItem item = event.getUploadItem();
      
       //Get data from temporary created file
       File file = item.getFile();
       byte[] data = new byte[(int) file.length()];
       FileInputStream fileInputStream = new FileInputStream(file);
       fileInputStream.read(data);
      
       //Now update object
       org.dataisland.primitives.datatype.Blob blob = new org.dataisland.primitives.datatype.Blob();
       getEntity().setImage(blob);
       getEntity().getImage().setContent(data);
       getEntity().getImage().setContentType(item.getContentType());
       getEntity().getImage().setContentFileName(item.getFileName());
       }
      
       public void clearImage() throws Exception {
       getEntity().setImage(null);
       }

      As you can see I use the rendered attribute on the panelGrid and the fileUpload to decide which section should be hidden and which one shouldn't.

      For a reason I do not understand, the render/reRender works on the commandLink but not on the fileUpload.

      Could someone explain what I am doing wrong?

      Thank you

        • 1. Re: FileUpload rerender
          ilya_shaikovsky

          formAction scope?

          any errors in a4j:log.

          • 2. Re: FileUpload rerender
            frer

            Hi Ilya,

            formAction scope is Conversation.

            I must admit I didn't know about a4j:log. I tried it and get a huge log. In this log I saw one error:


            error[8:58:51,270]: Error on parsing JSON data syntax error


            Does this help you?


            Here is the full log from the moment I chose my file in the uploader (sorry if its long I don't exactly know what is pertinent):


            debug[8:58:50,145]: Query preparation for form 'item-form' requested
            debug[8:58:50,145]: Append hidden control item-form with value [item-form] and value attribute [item-form]
            debug[8:58:50,146]: Append text control item-form:j_id114:j_id119:0:item-itemName-value with value [] and value attribute []
            debug[8:58:50,146]: Append text control item-form:j_id114:j_id119:1:item-itemName-value with value [] and value attribute []
            debug[8:58:50,146]: Append text control item-form:j_id114:item-listPrice-value with value [] and value attribute [null]
            debug[8:58:50,146]: Append file control item-form:j_id114:item-image-value-upload:file with value [Chrysanthemum.jpg] and value attribute [null]
            debug[8:58:50,147]: Append file control item-form:j_id114:item-image-value-upload:file with value [] and value attribute [null]
            debug[8:58:50,147]: Append text control item-form:j_id114:item-lastModifiedDate-valueInputDate with value [] and value attribute [null]
            debug[8:58:50,147]: Append hidden control item-form:j_id114:item-lastModifiedDate-valueInputCurrentDate with value [08/2009] and value attribute [08/2009]
            debug[8:58:50,148]: Append select-one control item-form:j_id114:item-isActive-value with value [] and value attribute [null]
            debug[8:58:50,148]: Append select-one control item-form:j_id114:item-size-value with value [org.jboss.seam.ui.NoSelectionConverter.noSelectionValue] and value attribute [null]
            debug[8:58:50,148]: Append select-one control item-form:j_id114:item-color-value with value [org.jboss.seam.ui.NoSelectionConverter.noSelectionValue] and value attribute [null]
            debug[8:58:50,148]: Append hidden control javax.faces.ViewState with value [j_id19] and value attribute [j_id19]
            debug[8:58:50,149]: parameter ajaxSingle with value item-form:j_id114:item-image-value-upload
            debug[8:58:50,149]: parameter _richfaces_upload_uid with value 0.39911489205330364
            debug[8:58:50,149]: parameter _richfaces_file_upload_action with value progress
            debug[8:58:50,149]: parameter item-form:j_id114:item-image-value-upload with value item-form:j_id114:item-image-value-upload
            debug[8:58:50,149]: Look up queue with default name
            debug[8:58:50,150]: NEW AJAX REQUEST !!! with form: item-form
            debug[8:58:50,150]: Start XmlHttpRequest
            debug[8:58:50,151]: Reqest state : 1
            debug[8:58:50,152]: QueryString: AJAXREQUEST=_viewRoot&item-form=item-form&item-form%3Aj_id114%3Aj_id119%3A0%3Aitem-itemName-value=&item-form%3Aj_id114%3Aj_id119%3A1%3Aitem-itemName-value=&item-form%3Aj_id114%3Aitem-listPrice-value=&item-form%3Aj_id114%3Aitem-image-value-upload%3Afile=Chrysanthemum.jpg&item-form%3Aj_id114%3Aitem-image-value-upload%3Afile=&item-form%3Aj_id114%3Aitem-lastModifiedDate-valueInputDate=&item-form%3Aj_id114%3Aitem-lastModifiedDate-valueInputCurrentDate=08%2F2009&item-form%3Aj_id114%3Aitem-isActive-value=&item-form%3Aj_id114%3Aitem-size-value=org.jboss.seam.ui.NoSelectionConverter.noSelectionValue&item-form%3Aj_id114%3Aitem-color-value=org.jboss.seam.ui.NoSelectionConverter.noSelectionValue&javax.faces.ViewState=j_id19&ajaxSingle=item-form%3Aj_id114%3Aitem-image-value-upload&_richfaces_upload_uid=0.39911489205330364&_richfaces_file_upload_action=progress&item-form%3Aj_id114%3Aitem-image-value-upload=item-form%3Aj_id114%3Aitem-image-value-upload&
            debug[8:58:50,154]: Reqest state : 1
            debug[8:58:51,266]: Reqest state : 2
            debug[8:58:51,267]: Reqest state : 3
            debug[8:58:51,268]: Reqest state : 4
            debug[8:58:51,268]: Reqest end with state 4
            debug[8:58:51,268]: Response with content-type: text/xml;charset=UTF-8
            debug[8:58:51,268]: Full response content: <?xml version="1.0"?> <html xmlns="http://www.w3.org/1999/xhtml"><head><title></title></head><body><span id="j_id93"></span><span id="item-form:j_id114:j_id119:0:j_id124" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:j_id119:1:j_id124" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:j_id130" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:j_id136" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:j_id142" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:j_id150" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:item-size-messages" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:item-color-messages" class="rich-message message"><span class="rich-message-label"></span></span><meta name="Ajax-Update-Ids" content="j_id93,item-form:j_id114:j_id119:0:j_id124,item-form:j_id114:j_id119:1:j_id124,item-form:j_id114:j_id130,item-form:j_id114:j_id136,item-form:j_id114:j_id142,item-form:j_id114:j_id150,item-form:j_id114:item-size-messages,item-form:j_id114:item-color-messages" /><span id="ajax-view-state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id19" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /><span id="_ajax:data"></span></body></html>
            debug[8:58:51,269]: Header Ajax-Expired not found, search in <meta>
            debug[8:58:51,269]: search for elements by name 'meta' in element #document
            debug[8:58:51,269]: Find <meta name='Ajax-Update-Ids' content='j_id93,item-form:j_id114:j_id119:0:j_id124,item-form:j_id114:j_id119:1:j_id124,item-form:j_id114:j_id130,item-form:j_id114:j_id136,item-form:j_id114:j_id142,item-form:j_id114:j_id150,item-form:j_id114:item-size-messages,item-form:j_id114:item-color-messages'>
            debug[8:58:51,270]: Find <meta name='Ajax-Response' content='true'>
            debug[8:58:51,270]: call getElementById for id= _ajax:data
            error[8:58:51,270]: Error on parsing JSON data syntax error
            debug[8:58:51,270]: Call local onbeforedomupdate function before replacing elemements
            debug[8:58:51,271]: Header Ajax-Update-Ids not found, search in <meta>
            debug[8:58:51,271]: search for elements by name 'meta' in element #document
            debug[8:58:51,271]: Find <meta name='Ajax-Update-Ids' content='j_id93,item-form:j_id114:j_id119:0:j_id124,item-form:j_id114:j_id119:1:j_id124,item-form:j_id114:j_id130,item-form:j_id114:j_id136,item-form:j_id114:j_id142,item-form:j_id114:j_id150,item-form:j_id114:item-size-messages,item-form:j_id114:item-color-messages'>
            debug[8:58:51,271]: Update page by list of rendered areas from response j_id93,item-form:j_id114:j_id119:0:j_id124,item-form:j_id114:j_id119:1:j_id124,item-form:j_id114:j_id130,item-form:j_id114:j_id136,item-form:j_id114:j_id142,item-form:j_id114:j_id150,item-form:j_id114:item-size-messages,item-form:j_id114:item-color-messages
            debug[8:58:51,272]: search for elements by name 'script' in element #document
            debug[8:58:51,272]: search for elements by name 'link' in element #document
            debug[8:58:51,273]: call getElementById for id= org.ajax4jsf.queue_script
            debug[8:58:51,273]: Update page part from call parameter for ID j_id93
            debug[8:58:51,273]: call getElementById for id= j_id93
            debug[8:58:51,274]: Replace content of node by replaceChild()
            debug[8:58:51,274]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:51,275]: Restoring document.getElementById()
            debug[8:58:51,275]: search for elements by name 'script' in element span
            debug[8:58:51,275]: Scripts in updated part count : 0
            debug[8:58:51,275]: Update part of page for Id: j_id93 successful
            debug[8:58:51,276]: Update page part from call parameter for ID item-form:j_id114:j_id119:0:j_id124
            debug[8:58:51,276]: call getElementById for id= item-form:j_id114:j_id119:0:j_id124
            debug[8:58:51,276]: Replace content of node by replaceChild()
            debug[8:58:51,277]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:51,277]: Restoring document.getElementById()
            debug[8:58:51,277]: search for elements by name 'script' in element span
            debug[8:58:51,277]: Scripts in updated part count : 0
            debug[8:58:51,278]: Update part of page for Id: item-form:j_id114:j_id119:0:j_id124 successful
            debug[8:58:51,278]: Update page part from call parameter for ID item-form:j_id114:j_id119:1:j_id124
            debug[8:58:51,278]: call getElementById for id= item-form:j_id114:j_id119:1:j_id124
            debug[8:58:51,279]: Replace content of node by replaceChild()
            debug[8:58:51,279]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:51,279]: Restoring document.getElementById()
            debug[8:58:51,280]: search for elements by name 'script' in element span
            debug[8:58:51,280]: Scripts in updated part count : 0
            debug[8:58:51,280]: Update part of page for Id: item-form:j_id114:j_id119:1:j_id124 successful
            debug[8:58:51,281]: Update page part from call parameter for ID item-form:j_id114:j_id130
            debug[8:58:51,281]: call getElementById for id= item-form:j_id114:j_id130
            debug[8:58:51,282]: Replace content of node by replaceChild()
            debug[8:58:51,282]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:51,283]: Restoring document.getElementById()
            debug[8:58:51,283]: search for elements by name 'script' in element span
            debug[8:58:51,283]: Scripts in updated part count : 0
            debug[8:58:51,283]: Update part of page for Id: item-form:j_id114:j_id130 successful
            debug[8:58:51,283]: Update page part from call parameter for ID item-form:j_id114:j_id136
            debug[8:58:51,284]: call getElementById for id= item-form:j_id114:j_id136
            debug[8:58:51,284]: Replace content of node by replaceChild()
            debug[8:58:51,284]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:51,285]: Restoring document.getElementById()
            debug[8:58:51,285]: search for elements by name 'script' in element span
            debug[8:58:51,285]: Scripts in updated part count : 0
            debug[8:58:51,286]: Update part of page for Id: item-form:j_id114:j_id136 successful
            debug[8:58:51,286]: Update page part from call parameter for ID item-form:j_id114:j_id142
            debug[8:58:51,286]: call getElementById for id= item-form:j_id114:j_id142
            debug[8:58:51,287]: Replace content of node by replaceChild()
            debug[8:58:51,287]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:51,287]: Restoring document.getElementById()
            debug[8:58:51,287]: search for elements by name 'script' in element span
            debug[8:58:51,288]: Scripts in updated part count : 0
            debug[8:58:51,288]: Update part of page for Id: item-form:j_id114:j_id142 successful
            debug[8:58:51,288]: Update page part from call parameter for ID item-form:j_id114:j_id150
            debug[8:58:51,288]: call getElementById for id= item-form:j_id114:j_id150
            debug[8:58:51,289]: Replace content of node by replaceChild()
            debug[8:58:51,289]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:51,289]: Restoring document.getElementById()
            debug[8:58:51,289]: search for elements by name 'script' in element span
            debug[8:58:51,290]: Scripts in updated part count : 0
            debug[8:58:51,290]: Update part of page for Id: item-form:j_id114:j_id150 successful
            debug[8:58:51,290]: Update page part from call parameter for ID item-form:j_id114:item-size-messages
            debug[8:58:51,290]: call getElementById for id= item-form:j_id114:item-size-messages
            debug[8:58:51,291]: Replace content of node by replaceChild()
            debug[8:58:51,291]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:51,291]: Restoring document.getElementById()
            debug[8:58:51,291]: search for elements by name 'script' in element span
            debug[8:58:51,291]: Scripts in updated part count : 0
            debug[8:58:51,292]: Update part of page for Id: item-form:j_id114:item-size-messages successful
            debug[8:58:51,292]: Update page part from call parameter for ID item-form:j_id114:item-color-messages
            debug[8:58:51,292]: call getElementById for id= item-form:j_id114:item-color-messages
            debug[8:58:51,292]: Replace content of node by replaceChild()
            debug[8:58:51,293]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:51,293]: Restoring document.getElementById()
            debug[8:58:51,293]: search for elements by name 'script' in element span
            debug[8:58:51,293]: Scripts in updated part count : 0
            debug[8:58:51,294]: call getElementById for id= org.ajax4jsf.oncomplete
            debug[8:58:51,294]: Processing updates finished, no oncomplete function to call
            debug[8:58:51,294]: Update part of page for Id: item-form:j_id114:item-color-messages successful
            debug[8:58:51,294]: call getElementById for id= ajax-view-state
            debug[8:58:51,294]: Hidden JSF state fields: [object HTMLSpanElement]
            debug[8:58:51,295]: Namespace for hidden view-state input fields is undefined
            debug[8:58:51,295]: search for elements by name 'input' in element span
            debug[8:58:51,295]: Replace value for inputs: 13 by new values: 1
            debug[8:58:51,295]: Input in response: javax.faces.ViewState
            debug[8:58:51,296]: Found same input on page with type: hidden
            debug[8:58:51,296]: Found same input on page with type: hidden
            debug[8:58:51,296]: Found same input on page with type: hidden
            debug[8:58:51,296]: search for elements by name 'INPUT' in element span
            debug[8:58:51,297]: Replace value for inputs: 13 by new values: 0
            debug[8:58:51,297]: call getElementById for id= _A4J.AJAX.focus
            debug[8:58:51,297]: No focus information in response
            debug[8:58:52,269]: Query preparation for form 'item-form' requested
            debug[8:58:52,269]: Append hidden control item-form with value [item-form] and value attribute [item-form]
            debug[8:58:52,270]: Append text control item-form:j_id114:j_id119:0:item-itemName-value with value [] and value attribute []
            debug[8:58:52,270]: Append text control item-form:j_id114:j_id119:1:item-itemName-value with value [] and value attribute []
            debug[8:58:52,270]: Append text control item-form:j_id114:item-listPrice-value with value [] and value attribute [null]
            debug[8:58:52,270]: Append file control item-form:j_id114:item-image-value-upload:file with value [Chrysanthemum.jpg] and value attribute [null]
            debug[8:58:52,271]: Append file control item-form:j_id114:item-image-value-upload:file with value [] and value attribute [null]
            debug[8:58:52,271]: Append text control item-form:j_id114:item-lastModifiedDate-valueInputDate with value [] and value attribute [null]
            debug[8:58:52,271]: Append hidden control item-form:j_id114:item-lastModifiedDate-valueInputCurrentDate with value [08/2009] and value attribute [08/2009]
            debug[8:58:52,271]: Append select-one control item-form:j_id114:item-isActive-value with value [] and value attribute [null]
            debug[8:58:52,272]: Append select-one control item-form:j_id114:item-size-value with value [org.jboss.seam.ui.NoSelectionConverter.noSelectionValue] and value attribute [null]
            debug[8:58:52,272]: Append select-one control item-form:j_id114:item-color-value with value [org.jboss.seam.ui.NoSelectionConverter.noSelectionValue] and value attribute [null]
            debug[8:58:52,272]: Append hidden control javax.faces.ViewState with value [j_id19] and value attribute [j_id19]
            debug[8:58:52,273]: parameter ajaxSingle with value item-form:j_id114:item-image-value-upload
            debug[8:58:52,273]: parameter _richfaces_upload_uid with value 0.39911489205330364
            debug[8:58:52,273]: parameter _richfaces_file_upload_action with value progress
            debug[8:58:52,274]: parameter item-form:j_id114:item-image-value-upload with value item-form:j_id114:item-image-value-upload
            debug[8:58:52,275]: Look up queue with default name
            debug[8:58:52,275]: NEW AJAX REQUEST !!! with form: item-form
            debug[8:58:52,275]: Start XmlHttpRequest
            debug[8:58:52,276]: Reqest state : 1
            debug[8:58:52,276]: QueryString: AJAXREQUEST=_viewRoot&item-form=item-form&item-form%3Aj_id114%3Aj_id119%3A0%3Aitem-itemName-value=&item-form%3Aj_id114%3Aj_id119%3A1%3Aitem-itemName-value=&item-form%3Aj_id114%3Aitem-listPrice-value=&item-form%3Aj_id114%3Aitem-image-value-upload%3Afile=Chrysanthemum.jpg&item-form%3Aj_id114%3Aitem-image-value-upload%3Afile=&item-form%3Aj_id114%3Aitem-lastModifiedDate-valueInputDate=&item-form%3Aj_id114%3Aitem-lastModifiedDate-valueInputCurrentDate=08%2F2009&item-form%3Aj_id114%3Aitem-isActive-value=&item-form%3Aj_id114%3Aitem-size-value=org.jboss.seam.ui.NoSelectionConverter.noSelectionValue&item-form%3Aj_id114%3Aitem-color-value=org.jboss.seam.ui.NoSelectionConverter.noSelectionValue&javax.faces.ViewState=j_id19&ajaxSingle=item-form%3Aj_id114%3Aitem-image-value-upload&_richfaces_upload_uid=0.39911489205330364&_richfaces_file_upload_action=progress&item-form%3Aj_id114%3Aitem-image-value-upload=item-form%3Aj_id114%3Aitem-image-value-upload&
            debug[8:58:52,279]: Reqest state : 1
            debug[8:58:52,431]: Have Event [object Object] with properties: target: [object HTMLDivElement], srcElement: undefined, type: dataavailable
            debug[8:58:52,432]: Query preparation for form 'item-form' requested
            debug[8:58:52,432]: Append hidden control item-form with value [item-form] and value attribute [item-form]
            debug[8:58:52,432]: Append text control item-form:j_id114:j_id119:0:item-itemName-value with value [] and value attribute []
            debug[8:58:52,433]: Append text control item-form:j_id114:j_id119:1:item-itemName-value with value [] and value attribute []
            debug[8:58:52,433]: Append text control item-form:j_id114:item-listPrice-value with value [] and value attribute [null]
            debug[8:58:52,433]: Append file control item-form:j_id114:item-image-value-upload:file with value [] and value attribute [null]
            debug[8:58:52,434]: Append text control item-form:j_id114:item-lastModifiedDate-valueInputDate with value [] and value attribute [null]
            debug[8:58:52,434]: Append hidden control item-form:j_id114:item-lastModifiedDate-valueInputCurrentDate with value [08/2009] and value attribute [08/2009]
            debug[8:58:52,434]: Append select-one control item-form:j_id114:item-isActive-value with value [] and value attribute [null]
            debug[8:58:52,434]: Append select-one control item-form:j_id114:item-size-value with value [org.jboss.seam.ui.NoSelectionConverter.noSelectionValue] and value attribute [null]
            debug[8:58:52,435]: Append select-one control item-form:j_id114:item-color-value with value [org.jboss.seam.ui.NoSelectionConverter.noSelectionValue] and value attribute [null]
            debug[8:58:52,435]: Append hidden control javax.faces.ViewState with value [j_id19] and value attribute [j_id19]
            debug[8:58:52,435]: parameter item-form:j_id114:j_id134 with value item-form:j_id114:j_id134
            debug[8:58:52,436]: parameter ajaxSingle with value item-form:j_id114:item-image-value-upload
            debug[8:58:52,436]: Look up queue with default name
            debug[8:58:52,436]: NEW AJAX REQUEST !!! with form: item-form
            debug[8:58:52,437]: Start XmlHttpRequest
            debug[8:58:52,437]: Reqest state : 1
            debug[8:58:52,438]: QueryString: AJAXREQUEST=_viewRoot&item-form=item-form&item-form%3Aj_id114%3Aj_id119%3A0%3Aitem-itemName-value=&item-form%3Aj_id114%3Aj_id119%3A1%3Aitem-itemName-value=&item-form%3Aj_id114%3Aitem-listPrice-value=&item-form%3Aj_id114%3Aitem-image-value-upload%3Afile=&item-form%3Aj_id114%3Aitem-lastModifiedDate-valueInputDate=&item-form%3Aj_id114%3Aitem-lastModifiedDate-valueInputCurrentDate=08%2F2009&item-form%3Aj_id114%3Aitem-isActive-value=&item-form%3Aj_id114%3Aitem-size-value=org.jboss.seam.ui.NoSelectionConverter.noSelectionValue&item-form%3Aj_id114%3Aitem-color-value=org.jboss.seam.ui.NoSelectionConverter.noSelectionValue&javax.faces.ViewState=j_id19&item-form_link_hidden_=item-form%3Aj_id114%3Aitem-image-value-upload&item-form%3Aj_id114%3Aj_id134=item-form%3Aj_id114%3Aj_id134&ajaxSingle=item-form%3Aj_id114%3Aitem-image-value-upload&
            debug[8:58:52,440]: Reqest state : 1
            debug[8:58:52,524]: Reqest state : 2
            debug[8:58:52,525]: Reqest state : 3
            debug[8:58:52,526]: Reqest state : 4
            debug[8:58:52,526]: Reqest end with state 4
            debug[8:58:52,527]: Response with content-type: text/xml;charset=UTF-8
            debug[8:58:52,527]: Full response content: <?xml version="1.0"?> <html xmlns="http://www.w3.org/1999/xhtml"><head><title></title></head><body><span id="j_id93"></span><span id="item-form:j_id114:j_id119:0:j_id124" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:j_id119:1:j_id124" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:j_id130" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:j_id136" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:j_id142" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:j_id150" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:item-size-messages" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:item-color-messages" class="rich-message message"><span class="rich-message-label"></span></span><meta name="Ajax-Update-Ids" content="j_id93,item-form:j_id114:j_id119:0:j_id124,item-form:j_id114:j_id119:1:j_id124,item-form:j_id114:j_id130,item-form:j_id114:j_id136,item-form:j_id114:j_id142,item-form:j_id114:j_id150,item-form:j_id114:item-size-messages,item-form:j_id114:item-color-messages" /><span id="ajax-view-state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id19" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /></body></html>
            debug[8:58:52,527]: Header Ajax-Expired not found, search in <meta>
            debug[8:58:52,527]: search for elements by name 'meta' in element #document
            debug[8:58:52,528]: Find <meta name='Ajax-Update-Ids' content='j_id93,item-form:j_id114:j_id119:0:j_id124,item-form:j_id114:j_id119:1:j_id124,item-form:j_id114:j_id130,item-form:j_id114:j_id136,item-form:j_id114:j_id142,item-form:j_id114:j_id150,item-form:j_id114:item-size-messages,item-form:j_id114:item-color-messages'>
            debug[8:58:52,528]: Find <meta name='Ajax-Response' content='true'>
            debug[8:58:52,528]: call getElementById for id= _ajax:data
            debug[8:58:52,529]: Call local onbeforedomupdate function before replacing elemements
            debug[8:58:52,529]: Header Ajax-Update-Ids not found, search in <meta>
            debug[8:58:52,529]: search for elements by name 'meta' in element #document
            debug[8:58:52,530]: Find <meta name='Ajax-Update-Ids' content='j_id93,item-form:j_id114:j_id119:0:j_id124,item-form:j_id114:j_id119:1:j_id124,item-form:j_id114:j_id130,item-form:j_id114:j_id136,item-form:j_id114:j_id142,item-form:j_id114:j_id150,item-form:j_id114:item-size-messages,item-form:j_id114:item-color-messages'>
            debug[8:58:52,530]: Update page by list of rendered areas from response j_id93,item-form:j_id114:j_id119:0:j_id124,item-form:j_id114:j_id119:1:j_id124,item-form:j_id114:j_id130,item-form:j_id114:j_id136,item-form:j_id114:j_id142,item-form:j_id114:j_id150,item-form:j_id114:item-size-messages,item-form:j_id114:item-color-messages
            debug[8:58:52,530]: search for elements by name 'script' in element #document
            debug[8:58:52,530]: search for elements by name 'link' in element #document
            debug[8:58:52,531]: call getElementById for id= org.ajax4jsf.queue_script
            debug[8:58:52,531]: Update page part from call parameter for ID j_id93
            debug[8:58:52,531]: call getElementById for id= j_id93
            debug[8:58:52,532]: Replace content of node by replaceChild()
            debug[8:58:52,533]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,533]: Restoring document.getElementById()
            debug[8:58:52,533]: search for elements by name 'script' in element span
            debug[8:58:52,534]: Scripts in updated part count : 0
            debug[8:58:52,534]: Update part of page for Id: j_id93 successful
            debug[8:58:52,534]: Update page part from call parameter for ID item-form:j_id114:j_id119:0:j_id124
            debug[8:58:52,534]: call getElementById for id= item-form:j_id114:j_id119:0:j_id124
            debug[8:58:52,535]: Replace content of node by replaceChild()
            debug[8:58:52,535]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,535]: Restoring document.getElementById()
            debug[8:58:52,536]: search for elements by name 'script' in element span
            debug[8:58:52,536]: Scripts in updated part count : 0
            debug[8:58:52,536]: Update part of page for Id: item-form:j_id114:j_id119:0:j_id124 successful
            debug[8:58:52,536]: Update page part from call parameter for ID item-form:j_id114:j_id119:1:j_id124
            debug[8:58:52,536]: call getElementById for id= item-form:j_id114:j_id119:1:j_id124
            debug[8:58:52,537]: Replace content of node by replaceChild()
            debug[8:58:52,537]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,538]: Restoring document.getElementById()
            debug[8:58:52,538]: search for elements by name 'script' in element span
            debug[8:58:52,538]: Scripts in updated part count : 0
            debug[8:58:52,539]: Update part of page for Id: item-form:j_id114:j_id119:1:j_id124 successful
            debug[8:58:52,539]: Update page part from call parameter for ID item-form:j_id114:j_id130
            debug[8:58:52,539]: call getElementById for id= item-form:j_id114:j_id130
            debug[8:58:52,540]: Replace content of node by replaceChild()
            debug[8:58:52,540]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,540]: Restoring document.getElementById()
            debug[8:58:52,540]: search for elements by name 'script' in element span
            debug[8:58:52,541]: Scripts in updated part count : 0
            debug[8:58:52,541]: Update part of page for Id: item-form:j_id114:j_id130 successful
            debug[8:58:52,541]: Update page part from call parameter for ID item-form:j_id114:j_id136
            debug[8:58:52,541]: call getElementById for id= item-form:j_id114:j_id136
            debug[8:58:52,542]: Replace content of node by replaceChild()
            debug[8:58:52,542]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,543]: Restoring document.getElementById()
            debug[8:58:52,543]: search for elements by name 'script' in element span
            debug[8:58:52,543]: Scripts in updated part count : 0
            debug[8:58:52,543]: Update part of page for Id: item-form:j_id114:j_id136 successful
            debug[8:58:52,544]: Update page part from call parameter for ID item-form:j_id114:j_id142
            debug[8:58:52,544]: call getElementById for id= item-form:j_id114:j_id142
            debug[8:58:52,545]: Replace content of node by replaceChild()
            debug[8:58:52,545]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,546]: Restoring document.getElementById()
            debug[8:58:52,546]: search for elements by name 'script' in element span
            debug[8:58:52,546]: Scripts in updated part count : 0
            debug[8:58:52,546]: Update part of page for Id: item-form:j_id114:j_id142 successful
            debug[8:58:52,546]: Update page part from call parameter for ID item-form:j_id114:j_id150
            debug[8:58:52,547]: call getElementById for id= item-form:j_id114:j_id150
            debug[8:58:52,547]: Replace content of node by replaceChild()
            debug[8:58:52,547]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,548]: Restoring document.getElementById()
            debug[8:58:52,548]: search for elements by name 'script' in element span
            debug[8:58:52,548]: Scripts in updated part count : 0
            debug[8:58:52,548]: Update part of page for Id: item-form:j_id114:j_id150 successful
            debug[8:58:52,548]: Update page part from call parameter for ID item-form:j_id114:item-size-messages
            debug[8:58:52,549]: call getElementById for id= item-form:j_id114:item-size-messages
            debug[8:58:52,549]: Replace content of node by replaceChild()
            debug[8:58:52,550]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,550]: Restoring document.getElementById()
            debug[8:58:52,550]: search for elements by name 'script' in element span
            debug[8:58:52,550]: Scripts in updated part count : 0
            debug[8:58:52,551]: Update part of page for Id: item-form:j_id114:item-size-messages successful
            debug[8:58:52,551]: Update page part from call parameter for ID item-form:j_id114:item-color-messages
            debug[8:58:52,551]: call getElementById for id= item-form:j_id114:item-color-messages
            debug[8:58:52,552]: Replace content of node by replaceChild()
            debug[8:58:52,552]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,553]: Restoring document.getElementById()
            debug[8:58:52,553]: search for elements by name 'script' in element span
            debug[8:58:52,553]: Scripts in updated part count : 0
            debug[8:58:52,553]: call getElementById for id= org.ajax4jsf.oncomplete
            debug[8:58:52,554]: Processing updates finished, no oncomplete function to call
            debug[8:58:52,554]: Update part of page for Id: item-form:j_id114:item-color-messages successful
            debug[8:58:52,554]: call getElementById for id= ajax-view-state
            debug[8:58:52,554]: Hidden JSF state fields: [object HTMLSpanElement]
            debug[8:58:52,554]: Namespace for hidden view-state input fields is undefined
            debug[8:58:52,555]: search for elements by name 'input' in element span
            debug[8:58:52,555]: Replace value for inputs: 12 by new values: 1
            debug[8:58:52,555]: Input in response: javax.faces.ViewState
            debug[8:58:52,556]: Found same input on page with type: hidden
            debug[8:58:52,556]: Found same input on page with type: hidden
            debug[8:58:52,556]: Found same input on page with type: hidden
            debug[8:58:52,556]: search for elements by name 'INPUT' in element span
            debug[8:58:52,557]: Replace value for inputs: 12 by new values: 0
            debug[8:58:52,557]: call getElementById for id= _A4J.AJAX.focus
            debug[8:58:52,557]: No focus information in response
            debug[8:58:52,608]: Reqest state : 2
            debug[8:58:52,609]: Reqest state : 3
            debug[8:58:52,609]: Reqest state : 4
            debug[8:58:52,610]: Reqest end with state 4
            debug[8:58:52,610]: Response with content-type: text/xml;charset=UTF-8
            debug[8:58:52,610]: Full response content: <?xml version="1.0"?> <html xmlns="http://www.w3.org/1999/xhtml"><head><title></title></head><body><span id="j_id93"></span><span id="item-form:j_id114:j_id119:0:j_id124" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:j_id119:1:j_id124" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:j_id130" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:j_id136" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:j_id142" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:j_id150" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:item-size-messages" class="rich-message message"><span class="rich-message-label"></span></span><span id="item-form:j_id114:item-color-messages" class="rich-message message"><span class="rich-message-label"></span></span><meta name="Ajax-Update-Ids" content="j_id93,item-form:j_id114:j_id119:0:j_id124,item-form:j_id114:j_id119:1:j_id124,item-form:j_id114:j_id130,item-form:j_id114:j_id136,item-form:j_id114:j_id142,item-form:j_id114:j_id150,item-form:j_id114:item-size-messages,item-form:j_id114:item-color-messages" /><span id="ajax-view-state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id19" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /></body></html>
            debug[8:58:52,611]: Header Ajax-Expired not found, search in <meta>
            debug[8:58:52,611]: search for elements by name 'meta' in element #document
            debug[8:58:52,611]: Find <meta name='Ajax-Update-Ids' content='j_id93,item-form:j_id114:j_id119:0:j_id124,item-form:j_id114:j_id119:1:j_id124,item-form:j_id114:j_id130,item-form:j_id114:j_id136,item-form:j_id114:j_id142,item-form:j_id114:j_id150,item-form:j_id114:item-size-messages,item-form:j_id114:item-color-messages'>
            debug[8:58:52,612]: Find <meta name='Ajax-Response' content='true'>
            debug[8:58:52,612]: Header Ajax-Update-Ids not found, search in <meta>
            debug[8:58:52,612]: search for elements by name 'meta' in element #document
            debug[8:58:52,612]: Find <meta name='Ajax-Update-Ids' content='j_id93,item-form:j_id114:j_id119:0:j_id124,item-form:j_id114:j_id119:1:j_id124,item-form:j_id114:j_id130,item-form:j_id114:j_id136,item-form:j_id114:j_id142,item-form:j_id114:j_id150,item-form:j_id114:item-size-messages,item-form:j_id114:item-color-messages'>
            debug[8:58:52,613]: Update page by list of rendered areas from response j_id93,item-form:j_id114:j_id119:0:j_id124,item-form:j_id114:j_id119:1:j_id124,item-form:j_id114:j_id130,item-form:j_id114:j_id136,item-form:j_id114:j_id142,item-form:j_id114:j_id150,item-form:j_id114:item-size-messages,item-form:j_id114:item-color-messages
            debug[8:58:52,613]: search for elements by name 'script' in element #document
            debug[8:58:52,613]: search for elements by name 'link' in element #document
            debug[8:58:52,614]: call getElementById for id= org.ajax4jsf.queue_script
            debug[8:58:52,614]: Update page part from call parameter for ID j_id93
            debug[8:58:52,614]: call getElementById for id= j_id93
            debug[8:58:52,614]: Replace content of node by replaceChild()
            debug[8:58:52,615]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,615]: Restoring document.getElementById()
            debug[8:58:52,615]: search for elements by name 'script' in element span
            debug[8:58:52,615]: Scripts in updated part count : 0
            debug[8:58:52,615]: Update part of page for Id: j_id93 successful
            debug[8:58:52,616]: Update page part from call parameter for ID item-form:j_id114:j_id119:0:j_id124
            debug[8:58:52,616]: call getElementById for id= item-form:j_id114:j_id119:0:j_id124
            debug[8:58:52,616]: Replace content of node by replaceChild()
            debug[8:58:52,616]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,617]: Restoring document.getElementById()
            debug[8:58:52,617]: search for elements by name 'script' in element span
            debug[8:58:52,617]: Scripts in updated part count : 0
            debug[8:58:52,617]: Update part of page for Id: item-form:j_id114:j_id119:0:j_id124 successful
            debug[8:58:52,618]: Update page part from call parameter for ID item-form:j_id114:j_id119:1:j_id124
            debug[8:58:52,618]: call getElementById for id= item-form:j_id114:j_id119:1:j_id124
            debug[8:58:52,618]: Replace content of node by replaceChild()
            debug[8:58:52,618]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,619]: Restoring document.getElementById()
            debug[8:58:52,619]: search for elements by name 'script' in element span
            debug[8:58:52,619]: Scripts in updated part count : 0
            debug[8:58:52,619]: Update part of page for Id: item-form:j_id114:j_id119:1:j_id124 successful
            debug[8:58:52,619]: Update page part from call parameter for ID item-form:j_id114:j_id130
            debug[8:58:52,620]: call getElementById for id= item-form:j_id114:j_id130
            debug[8:58:52,620]: Replace content of node by replaceChild()
            debug[8:58:52,620]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,620]: Restoring document.getElementById()
            debug[8:58:52,621]: search for elements by name 'script' in element span
            debug[8:58:52,621]: Scripts in updated part count : 0
            debug[8:58:52,621]: Update part of page for Id: item-form:j_id114:j_id130 successful
            debug[8:58:52,621]: Update page part from call parameter for ID item-form:j_id114:j_id136
            debug[8:58:52,622]: call getElementById for id= item-form:j_id114:j_id136
            debug[8:58:52,622]: Replace content of node by replaceChild()
            debug[8:58:52,622]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,622]: Restoring document.getElementById()
            debug[8:58:52,623]: search for elements by name 'script' in element span
            debug[8:58:52,623]: Scripts in updated part count : 0
            debug[8:58:52,623]: Update part of page for Id: item-form:j_id114:j_id136 successful
            debug[8:58:52,623]: Update page part from call parameter for ID item-form:j_id114:j_id142
            debug[8:58:52,623]: call getElementById for id= item-form:j_id114:j_id142
            debug[8:58:52,624]: Replace content of node by replaceChild()
            debug[8:58:52,624]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,624]: Restoring document.getElementById()
            debug[8:58:52,624]: search for elements by name 'script' in element span
            debug[8:58:52,625]: Scripts in updated part count : 0
            debug[8:58:52,625]: Update part of page for Id: item-form:j_id114:j_id142 successful
            debug[8:58:52,625]: Update page part from call parameter for ID item-form:j_id114:j_id150
            debug[8:58:52,625]: call getElementById for id= item-form:j_id114:j_id150
            debug[8:58:52,626]: Replace content of node by replaceChild()
            debug[8:58:52,626]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,626]: Restoring document.getElementById()
            debug[8:58:52,626]: search for elements by name 'script' in element span
            debug[8:58:52,627]: Scripts in updated part count : 0
            debug[8:58:52,627]: Update part of page for Id: item-form:j_id114:j_id150 successful
            debug[8:58:52,627]: Update page part from call parameter for ID item-form:j_id114:item-size-messages
            debug[8:58:52,627]: call getElementById for id= item-form:j_id114:item-size-messages
            debug[8:58:52,627]: Replace content of node by replaceChild()
            debug[8:58:52,628]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,628]: Restoring document.getElementById()
            debug[8:58:52,628]: search for elements by name 'script' in element span
            debug[8:58:52,628]: Scripts in updated part count : 0
            debug[8:58:52,629]: Update part of page for Id: item-form:j_id114:item-size-messages successful
            debug[8:58:52,629]: Update page part from call parameter for ID item-form:j_id114:item-color-messages
            debug[8:58:52,629]: call getElementById for id= item-form:j_id114:item-color-messages
            debug[8:58:52,629]: Replace content of node by replaceChild()
            debug[8:58:52,630]: Temporarily substituting document.getElementById() to work around WebKit issue
            debug[8:58:52,630]: Restoring document.getElementById()
            debug[8:58:52,630]: search for elements by name 'script' in element span
            debug[8:58:52,630]: Scripts in updated part count : 0
            debug[8:58:52,630]: call getElementById for id= org.ajax4jsf.oncomplete
            debug[8:58:52,631]: Processing updates finished, no oncomplete function to call
            debug[8:58:52,631]: Update part of page for Id: item-form:j_id114:item-color-messages successful
            debug[8:58:52,631]: call getElementById for id= ajax-view-state
            debug[8:58:52,631]: Hidden JSF state fields: [object HTMLSpanElement]
            debug[8:58:52,631]: Namespace for hidden view-state input fields is undefined
            debug[8:58:52,632]: search for elements by name 'input' in element span
            debug[8:58:52,632]: Replace value for inputs: 12 by new values: 1
            debug[8:58:52,632]: Input in response: javax.faces.ViewState
            debug[8:58:52,632]: Found same input on page with type: hidden
            debug[8:58:52,632]: Found same input on page with type: hidden
            debug[8:58:52,633]: Found same input on page with type: hidden
            debug[8:58:52,633]: search for elements by name 'INPUT' in element span
            debug[8:58:52,633]: Replace value for inputs: 12 by new values: 0
            debug[8:58:52,633]: call getElementById for id= _A4J.AJAX.focus
            debug[8:58:52,634]: No focus information in response


            Thanks,

            François

            • 3. Re: FileUpload rerender
              frer

              Anyone have an idea? Should I file a bug (if so please direct me since I haven't done it yet)?

              • 4. Re: FileUpload rerender
                ilya_shaikovsky

                Actually see three requests and aby of them contains reRender id which you defined.

                Could you please simplify your page in order to include only the form with snippet you mentioned from the beggining and try again with just two controls. And provide new log then for just last support request.

                • 5. Re: FileUpload rerender
                  frer

                  Hey Ilya,

                  Sorry for the delay, I was having problems simplifying my test (go figure).

                  Here is my new xhtml:

                  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                  <html xmlns="http://www.w3.org/1999/xhtml"
                   xmlns:ui="http://java.sun.com/jsf/facelets"
                   xmlns:h="http://java.sun.com/jsf/html"
                   xmlns:f="http://java.sun.com/jsf/core"
                   xmlns:s="http://jboss.com/products/seam/taglib"
                   xmlns:a4j="http://richfaces.org/a4j"
                   xmlns:rich="http://richfaces.org/rich"
                   xmlns:c="http://java.sun.com/jstl/core">
                  
                  <f:view contentType="text/html">
                   <head>
                   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
                   </head>
                   <body>
                  
                   <a4j:outputPanel id="item-image-value-container">
                   <rich:fileUpload id="item-image-value"
                   label="#{messages['org.mdarad.samples.totaltest.product.Item.attributes.image']}"
                   fileUploadListener="#{product_item_actions_ItemWebFormAction.uploadImage}"
                   maxFilesQuantity="1"
                   immediateUpload="true"
                   immediate="true"
                   acceptedTypes="jpg, gif, png, bmp"
                   addControlLabel="#{messages['org.mdarad.framework.resources.list.add']} Image"
                   cancelEntryControlLabel="#{messages['org.mdarad.framework.resources.list.remove']} Image"
                   rendered="#{product_item_actions_ItemWebFormAction.entity.image == null}">
                   <a4j:support event="onuploadcomplete" reRender="item-image-value, item-image-value-preview, item-image-value-remove" />
                   </rich:fileUpload>
                   <h:panelGrid columns="2">
                   <s:graphicImage id="item-image-value-preview" value="#{product_item_actions_ItemWebFormAction.entity.image.content}" style="width:48px"/>
                   <a4j:commandLink id="item-image-value-remove"
                   action="#{product_item_actions_ItemWebFormAction.clearImage}"
                   value="#{messages['org.mdarad.framework.resources.list.remove']} Image"
                   reRender="item-image-value, item-image-value-preview, item-image-value-remove"
                   rendered="#{product_item_actions_ItemWebFormAction.entity.image != null}"/>
                   </h:panelGrid>
                   </a4j:outputPanel>
                  
                   <rich:message for="item-image-value" styleClass="message" infoClass="success" errorClass="error" warnClass="warning"/>
                   <a4j:log popup="false" level="ALL" style="width: 800px; height: 300px;"></a4j:log>
                   </body>
                  </f:view>
                  </html>


                  And here is the log, when I choose a file to upload:

                  debug[10:06:46,330]: Query preparation for form 'item-image-value:_form' requested
                  debug[10:06:46,331]: Append file control item-image-value:file with value [Forest.jpg] and value attribute [null]
                  debug[10:06:46,332]: Append file control item-image-value:file with value [] and value attribute [null]
                  debug[10:06:46,332]: Append hidden control javax.faces.ViewState with value [j_id7] and value attribute [j_id7]
                  debug[10:06:46,332]: parameter item-image-value with value item-image-value
                  debug[10:06:46,332]: parameter ajaxSingle with value item-image-value
                  debug[10:06:46,332]: parameter _richfaces_upload_uid with value 0.30394783796947733
                  debug[10:06:46,333]: parameter _richfaces_file_upload_action with value progress
                  debug[10:06:46,333]: Look up queue with default name
                  debug[10:06:46,333]: NEW AJAX REQUEST !!! with form: item-image-value:_form
                  debug[10:06:46,333]: Start XmlHttpRequest
                  debug[10:06:46,334]: Reqest state : 1
                  debug[10:06:46,334]: QueryString: AJAXREQUEST=_viewRoot&item-image-value%3Afile=Forest.jpg&item-image-value%3Afile=&javax.faces.ViewState=j_id7&item-image-value=item-image-value&ajaxSingle=item-image-value&_richfaces_upload_uid=0.30394783796947733&_richfaces_file_upload_action=progress&
                  debug[10:06:46,336]: Reqest state : 1
                  debug[10:06:47,430]: Reqest state : 2
                  debug[10:06:47,431]: Reqest state : 3
                  debug[10:06:47,432]: Reqest state : 4
                  debug[10:06:47,432]: Reqest end with state 4
                  debug[10:06:47,432]: Response with content-type: text/xml;charset=UTF-8
                  debug[10:06:47,432]: Full response content: <?xml version="1.0"?> <html xmlns="http://www.w3.org/1999/xhtml"><head><title></title></head><body><span id="j_id6" class="rich-message message"><span class="rich-message-label"></span></span><meta name="Ajax-Update-Ids" content="j_id6" /><span id="ajax-view-state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id7" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /><span id="_ajax:data"></span></body></html>
                  debug[10:06:47,433]: Header Ajax-Expired not found, search in <meta>
                  debug[10:06:47,433]: search for elements by name 'meta' in element #document
                  debug[10:06:47,434]: Find <meta name='Ajax-Update-Ids' content='j_id6'>
                  debug[10:06:47,434]: Find <meta name='Ajax-Response' content='true'>
                  debug[10:06:47,434]: call getElementById for id= _ajax:data
                  error[10:06:47,434]: Error on parsing JSON data syntax error
                  debug[10:06:47,434]: Call local onbeforedomupdate function before replacing elemements
                  debug[10:06:47,435]: Header Ajax-Update-Ids not found, search in <meta>
                  debug[10:06:47,435]: search for elements by name 'meta' in element #document
                  debug[10:06:47,435]: Find <meta name='Ajax-Update-Ids' content='j_id6'>
                  debug[10:06:47,435]: Update page by list of rendered areas from response j_id6
                  debug[10:06:47,435]: search for elements by name 'script' in element #document
                  debug[10:06:47,436]: search for elements by name 'link' in element #document
                  debug[10:06:47,436]: call getElementById for id= org.ajax4jsf.queue_script
                  debug[10:06:47,436]: Update page part from call parameter for ID j_id6
                  debug[10:06:47,436]: call getElementById for id= j_id6
                  debug[10:06:47,437]: Replace content of node by replaceChild()
                  debug[10:06:47,437]: Temporarily substituting document.getElementById() to work around WebKit issue
                  debug[10:06:47,437]: Restoring document.getElementById()
                  debug[10:06:47,438]: search for elements by name 'script' in element span
                  debug[10:06:47,438]: Scripts in updated part count : 0
                  debug[10:06:47,438]: call getElementById for id= org.ajax4jsf.oncomplete
                  debug[10:06:47,438]: Processing updates finished, no oncomplete function to call
                  debug[10:06:47,438]: Update part of page for Id: j_id6 successful
                  debug[10:06:47,438]: call getElementById for id= ajax-view-state
                  debug[10:06:47,439]: Hidden JSF state fields: [object HTMLSpanElement]
                  debug[10:06:47,439]: Namespace for hidden view-state input fields is undefined
                  debug[10:06:47,439]: search for elements by name 'input' in element span
                  debug[10:06:47,439]: Replace value for inputs: 3 by new values: 1
                  debug[10:06:47,439]: Input in response: javax.faces.ViewState
                  debug[10:06:47,440]: Found same input on page with type: hidden
                  debug[10:06:47,440]: search for elements by name 'INPUT' in element span
                  debug[10:06:47,440]: Replace value for inputs: 3 by new values: 0
                  debug[10:06:47,440]: call getElementById for id= _A4J.AJAX.focus
                  debug[10:06:47,440]: No focus information in response
                  debug[10:06:48,439]: Query preparation for form 'item-image-value:_form' requested
                  debug[10:06:48,439]: Append file control item-image-value:file with value [Forest.jpg] and value attribute [null]
                  debug[10:06:48,440]: Append file control item-image-value:file with value [] and value attribute [null]
                  debug[10:06:48,440]: Append hidden control javax.faces.ViewState with value [j_id7] and value attribute [j_id7]
                  debug[10:06:48,440]: parameter item-image-value with value item-image-value
                  debug[10:06:48,440]: parameter ajaxSingle with value item-image-value
                  debug[10:06:48,441]: parameter _richfaces_upload_uid with value 0.30394783796947733
                  debug[10:06:48,441]: parameter _richfaces_file_upload_action with value progress
                  debug[10:06:48,441]: Look up queue with default name
                  debug[10:06:48,441]: NEW AJAX REQUEST !!! with form: item-image-value:_form
                  debug[10:06:48,441]: Start XmlHttpRequest
                  debug[10:06:48,441]: Reqest state : 1
                  debug[10:06:48,442]: QueryString: AJAXREQUEST=_viewRoot&item-image-value%3Afile=Forest.jpg&item-image-value%3Afile=&javax.faces.ViewState=j_id7&item-image-value=item-image-value&ajaxSingle=item-image-value&_richfaces_upload_uid=0.30394783796947733&_richfaces_file_upload_action=progress&
                  debug[10:06:48,444]: Reqest state : 1
                  debug[10:06:48,448]: Have Event [object Object] with properties: target: [object HTMLDivElement], srcElement: undefined, type: dataavailable
                  debug[10:06:48,448]: Query preparation for form 'null' requested
                  debug[10:06:48,506]: Reqest state : 2
                  debug[10:06:48,506]: Reqest state : 3
                  debug[10:06:48,507]: Reqest state : 4
                  debug[10:06:48,507]: Reqest end with state 4
                  debug[10:06:48,507]: Response with content-type: text/xml;charset=UTF-8
                  debug[10:06:48,507]: Full response content: <?xml version="1.0"?> <html xmlns="http://www.w3.org/1999/xhtml"><head><title></title></head><body><span id="j_id6" class="rich-message message"><span class="rich-message-label"></span></span><meta name="Ajax-Update-Ids" content="j_id6" /><span id="ajax-view-state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id7" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /></body></html>
                  debug[10:06:48,508]: Header Ajax-Expired not found, search in <meta>
                  debug[10:06:48,508]: search for elements by name 'meta' in element #document
                  debug[10:06:48,508]: Find <meta name='Ajax-Update-Ids' content='j_id6'>
                  debug[10:06:48,508]: Find <meta name='Ajax-Response' content='true'>
                  debug[10:06:48,508]: call getElementById for id= _ajax:data
                  debug[10:06:48,509]: Call local onbeforedomupdate function before replacing elemements
                  debug[10:06:48,509]: Header Ajax-Update-Ids not found, search in <meta>
                  debug[10:06:48,509]: search for elements by name 'meta' in element #document
                  debug[10:06:48,509]: Find <meta name='Ajax-Update-Ids' content='j_id6'>
                  debug[10:06:48,509]: Update page by list of rendered areas from response j_id6
                  debug[10:06:48,509]: search for elements by name 'script' in element #document
                  debug[10:06:48,510]: search for elements by name 'link' in element #document
                  debug[10:06:48,510]: call getElementById for id= org.ajax4jsf.queue_script
                  debug[10:06:48,510]: Update page part from call parameter for ID j_id6
                  debug[10:06:48,510]: call getElementById for id= j_id6
                  debug[10:06:48,511]: Replace content of node by replaceChild()
                  debug[10:06:48,511]: Temporarily substituting document.getElementById() to work around WebKit issue
                  debug[10:06:48,511]: Restoring document.getElementById()
                  debug[10:06:48,511]: search for elements by name 'script' in element span
                  debug[10:06:48,512]: Scripts in updated part count : 0
                  debug[10:06:48,512]: call getElementById for id= org.ajax4jsf.oncomplete
                  debug[10:06:48,512]: Processing updates finished, no oncomplete function to call
                  debug[10:06:48,512]: Update part of page for Id: j_id6 successful
                  debug[10:06:48,512]: call getElementById for id= ajax-view-state
                  debug[10:06:48,513]: Hidden JSF state fields: [object HTMLSpanElement]
                  debug[10:06:48,513]: Namespace for hidden view-state input fields is undefined
                  debug[10:06:48,513]: search for elements by name 'input' in element span
                  debug[10:06:48,513]: Replace value for inputs: 2 by new values: 1
                  debug[10:06:48,513]: Input in response: javax.faces.ViewState
                  debug[10:06:48,513]: Found same input on page with type: hidden
                  debug[10:06:48,514]: search for elements by name 'INPUT' in element span
                  debug[10:06:48,514]: Replace value for inputs: 2 by new values: 0
                  debug[10:06:48,514]: call getElementById for id= _A4J.AJAX.focus
                  debug[10:06:48,514]: No focus information in response



                  Does this help? I still have the problem that the fileupload does not dissappear when the file is uploaded (and the image should appear)

                  • 6. Re: FileUpload rerender
                    frer

                    Hi Ilya,

                    Did you get a chance to look at my problem?

                    Thanks

                    • 7. Re: FileUpload rerender
                      nbelaevski

                      Hi,

                      You cannot re-render components that are not rendered (they are simply not processed) or were not rendered before (there are no HTML elements to update on the client side then). You can use a4j:outputPanel with layout="none" or re-render container (e.g. a4j:outputPanel with id="item-image-value-container").