2 Replies Latest reply on May 25, 2013 11:50 AM by cprietom

    a4j:support not rerendering

    funtoos

      I am using rich:fileupload which on completion of the upload calls a4j:support to rerender a success message. Fileupload works fine, but the success message is not displayed, I also tried updating a a text field.

       

      Environment : WAS7+JSF1.2+facelets1.1.14+richfaces3.3.3

      WEB-INF/lib contains

      el-api-1.1.jar

      el-impl-1.1.jar

      jsf-facelets-1.1.14.jar

      jsf-ibm.jar

      icu4j_3_4_1.jar

      richfaces-api-3.3.3.Final.jar

      richfaces-impl-3.3.3.Final.jar

      richfaces-ui-3.3.3.Final.jar

       

      xhtml file

       

      <html xmlns="http://www.w3.org/1999/xhtml"

            xmlns:h="http://java.sun.com/jsf/html"

            xmlns:f="http://java.sun.com/jsf/core"

            xmlns:ui="http://java.sun.com/jsf/facelets"

            xmlns:c="http://java.sun.com/jstl/core"

            xmlns:rich="http://richfaces.org/rich"

            xmlns:a4j="http://richfaces.org/a4j">

       

          <ui:composition template="/template.xhtml">

              <ui:define name="content">

                  <div id="content-nosidebar">

                      <h:form id="uploadDoc1" >

                          <h:panelGrid id="panelGridContact" headerClass="standardPageHeader" width="100%" cellpadding="5">

                              <f:facet name="header">

                                  <h:panelGroup>

                                      <h:outputText value="Upload Contact Info" />

                                      <hr/>

                                  </h:panelGroup>

                              </f:facet>

                              <a4j:outputPanel id="msgs">

                                  <h:messages />

                                  <h:outputText value="#{uploadContactCntrl.updtText}"/>

                              </a4j:outputPanel>

                              <h:panelGrid style="text-align: center;font-weight: bold;">

                                  <h:outputText value="Click on Browse button to identify CSV file with contact information for upload."/>

                                  <h:outputText value="File size limit is 10MB."/>

                                  <h:panelGroup>

                                        <rich:fileUpload id="fileuploader" fileUploadListener="#{uploadContactCntrl.onSubmit}"

                                            acceptedTypes="csv" allowFlash="true" listHeight="50" addControlLabel="Select File" uploadControlLabel="Submit" clearControlLabel="clear">

                                            <a4j:support event="onuploadcomplete" reRender="msgs"  />

                                        </rich:fileUpload>

                                  </h:panelGroup>

                              </h:panelGrid>

                          </h:panelGrid>

                      </h:form>

                      <a4j:log popup="false" level="ALL" style="width: 800px; height: 300px;"></a4j:log>

                      </div>

              </ui:define>

          </ui:composition>

      </html>

       

      .web.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

          <display-name>Blue2NCToolsWeb</display-name>

          <context-param>

              <description>The location where state information is saved. Valid values are 'server' (typically saved in HttpSession) and 'client' (typically saved as a hidden field in the form.

                          Default is server.

              </description>

              <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

              <param-value>server</param-value>

          </context-param>

          <context-param>

              <description>Comma-delimited list of context-relative resource paths under which the JSF implementation will look for application configuration resources,

                          before loading a configuration resource named /WEB-INF/facesconfig.xml (if such a resource exists).

              </description>

              <param-name>javax.faces.CONFIG_FILES</param-name>

              <param-value>/WEB-INF/faces-config.xml,/WEB-INF/faces-config-validators.xml</param-value>

          </context-param>

          <context-param>

              <description>The default suffix for extension-mapped resources that contain JSF components. Default is '.jsp'.</description>

              <param-name>javax.faces.DEFAULT_SUFFIX</param-name>

              <param-value>.xhtml</param-value>

          </context-param>

          <context-param>

              <description>

              Monitors Faces JSP files for modifications and synchronizes a running server with

      the changes without restarting the server. If this parameter is set to false or

      removed from the deployment descriptor, any changes made to Faces JSP files may

      not be seen by the server until it is restarted. This parameter is usually set

      to true while the Faces JSP files are being developed and debugged in order to

      improve the performance of the development environment.</description>

              <param-name>com.ibm.ws.jsf.JSP_UPDATE_CHECK</param-name>

              <param-value>true</param-value>

          </context-param>

          <context-param>

              <description>

              Load JSF runtime when the application server starts up. If this parameter is set to false or removed,

      JSF runtime will be loaded and initialized when the first JSF request is processed.

      This may disable custom JSF extensions, such as factories defined in the project.</description>

              <param-name>com.ibm.ws.jsf.LOAD_FACES_CONFIG_AT_STARTUP</param-name>

              <param-value>true</param-value>

          </context-param>

          <context-param>

              <description>

              If set to true disables use of MultipartFacesContext, allowing underlying implementations to be used.

      MultipartFacesContext is required when the FileUpload component is used, and can be disabled otherwise.</description>

              <param-name>com.ibm.faces.DISABLE_JWL_MULTIPART_CONTEXT</param-name>

              <param-value>false</param-value>

          </context-param>

          <context-param>

              <description>

              Value, in milliseconds, to be used for Expires header for resources served by the JavaScript Resource Servlet.

      Default is never (31536000000 milliseconds or 1 year).</description>

              <param-name>com.ibm.faces.RESOURCE_EXPIRE_MS</param-name>

              <param-value>31536000000</param-value>

          </context-param>

          <context-param>

              <description>

              Defines the strictness of the conversion when converting from a string to a date.

      The higher the value, the more exactly the value must conform to the format.

      If 0 (liberal), all 'literals' are ignored while parsing a value, mis-ordered components will be rearranged,

      any missing component is supplied using the current datetime, misspellings and incomplete spellings are allowed

      (to the extent that they can be evaluated), 'E' and other non-unique components are ignored.

      If 1 (strict), all 'literals' are ignored while parsing a value, any missing component is supplied using the current

      datetime, misspellings and incomplete spellings are allowed (to the extent that they can be evaluated),

      'E' and other non-unique components are ignored. For example if the pattern is MMMM dd, yyyy a user can enter 'Feb/02/04'

      and it will be parsed as February 02, 2004.

      If 2 (very strict), an exact match is required except long month names can be 'shortened' to the minimum number of unique

      characters and 'E' and other non-unique components are ignored. Literals must match exactly.

      Default is 1.</description>

              <param-name>com.ibm.faces.DATETIME_ASSIST_STRICTNESS</param-name>

              <param-value>1</param-value>

          </context-param>

          <context-param>

              <description>

              Defines the strictness of the conversion when converting from a string to a number.

      The higher the value, the more exactly the value must conform to the pattern.

      For numbers, currently strictness levels of 0 and 1 are equivalent. If the strictness is 2,

      if number is signed, the sign must be provided (otherwise it's assumed positive).

      Default is 1.</description>

              <param-name>com.ibm.faces.NUMBER_ASSIST_STRICTNESS</param-name>

              <param-value>1</param-value>

          </context-param>

          <context-param>

              <description>

              Defines the path for resources such as JavaScript libraries and images.

      The value can be either:

      1. An empty string. Context path of the current application will be used.

      2. A path string. Example: /project13. A number. Specifies the number of nodes to use from the context path starting from the left.

      Example: With a value of 1 if the context path is /screen/faces/SSID110267549/RID1102676

      the path will be evaluated as /screen

      Default is an empty string.</description>

              <param-name>com.ibm.faces.USE_UNENCODED_CONTEXT_PATH</param-name>

              <param-value></param-value>

          </context-param>

          <context-param>

              <description>

              Sets a custom url-pattern for the JavaScript Resource servlet.

      Should match servlet mapping setting for the JavaScript Resource servlet. If the default default mapping

      value '/.ibmjsfres/*' is modified, this context-param should also be modified.

      </description>

              <param-name>com.ibm.faces.JS_RESOURCE_SERVLET_URL_PATTERN</param-name>

              <param-value>/.ibmjsfres/*</param-value>

          </context-param>

          <context-param>

              <description>

              If set to true, forces JavaScript Resource Servlet to cache all resources on the server.

      This can be useful when client-side caching is turned off.</description>

              <param-name>com.ibm.faces.JS_RESOURCE_SERVLET_CACHE</param-name>

              <param-value>false</param-value>

          </context-param>

          <context-param>

              <description>

              Sets a custom charset mapping properties file similar to converter.properties in WAS.</description>

              <param-name>com.ibm.faces.ENCODING_MAPPING</param-name>

              <param-value>converter.properties</param-value>

          </context-param>

          <context-param>

              <description>

              If set to true, the entire JavaScript library, containing code for all components, will be included

      in the generated pages as one file. If set to false or removed, multiple smaller JavaScript files will be

      included, depending on the components used on the page.Default is false.</description>

              <param-name>com.ibm.faces.USE_HXCLIENT_FULL</param-name>

              <param-value>false</param-value>

          </context-param>

          <context-param>

              <description>

              Specifies maximum size for the request content processed by MultipartExternalContext.

      Can be used to prevent large files from being uploaded.

      Takes an integer value, in bytes. 0 or empty means there is no limit.

      Default is no limit.

      </description>

              <param-name>com.ibm.faces.MAX_REQUEST_CONTENT_SIZE</param-name>

              <param-value>0</param-value>

          </context-param>

          <context-param>

              <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>

              <param-value>com.sun.facelets.FaceletViewHandler</param-value>

          </context-param>

       

          <context-param> 

              <param-name>facelets.LIBRARIES</param-name> 

              <param-value>/WEB-INF/custom.taglib.xml</param-value> 

          </context-param>

       

       

      <!-- Making the RichFaces skin spread to standard HTML controls -->

       

      <!--

          <context-param>

              <param-name>org.richfaces.SKIN</param-name>

              <param-value>blueSky</param-value>

          </context-param>

       

          <context-param>

              <param-name>org.richfaces.CONTROL_SKINNING</param-name>

              <param-value>enable</param-value>

          </context-param>

      -->

       

          <context-param>

              <param-name>org.richfaces.LoadStyleStrategy</param-name>

              <param-value>ALL</param-value>

          </context-param>

       

          <context-param>

              <param-name>org.richfaces.LoadScriptStrategy</param-name>

              <param-value>ALL</param-value>

          </context-param>

       

      <!-- Defining and mapping the RichFaces filter -->

       

           <listener>

               <listener-class>com.sun.faces.config.ConfigureListener</listener-class>

           </listener>

       

          <filter>

                 <display-name>RichFaces Filter</display-name>

                 <filter-name>richfaces</filter-name>

                 <filter-class>org.ajax4jsf.Filter</filter-class>

              <init-param>

                  <param-name>createTempFiles</param-name>

                  <param-value>true</param-value>

              </init-param>   

              <init-param>

                  <param-name>maxRequestSize</param-name>

                  <param-value>100000000</param-value>

              </init-param>   

          </filter>

          <filter-mapping>

              <filter-name>richfaces</filter-name>

              <servlet-name>Faces Servlet</servlet-name>

              <dispatcher>REQUEST</dispatcher>

              <dispatcher>FORWARD</dispatcher>

              <dispatcher>INCLUDE</dispatcher>

          </filter-mapping>

          <servlet>

              <servlet-name>Faces Servlet</servlet-name>

              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

              <load-on-startup>1</load-on-startup>

          </servlet>

          <servlet>

              <servlet-name>JavaScript Resource Servlet</servlet-name>

              <servlet-class>com.ibm.faces.webapp.JSResourceServlet</servlet-class>

              <load-on-startup>-1</load-on-startup>

          </servlet>

          <servlet-mapping>

              <servlet-name>Faces Servlet</servlet-name>

              <url-pattern>

              *.faces</url-pattern>

          </servlet-mapping>

          <servlet-mapping>

              <servlet-name>Faces Servlet</servlet-name>

              <url-pattern>

              /faces/*</url-pattern>

          </servlet-mapping>

          <servlet-mapping>

              <servlet-name>JavaScript Resource Servlet</servlet-name>

              <url-pattern>

              /.ibmjsfres/*</url-pattern>

          </servlet-mapping>

          <welcome-file-list>

              <welcome-file>index.html</welcome-file>

              <welcome-file>index.htm</welcome-file>

              <welcome-file>index.jsp</welcome-file>

              <welcome-file>default.html</welcome-file>

              <welcome-file>default.htm</welcome-file>

              <welcome-file>default.jsp</welcome-file>

          </welcome-file-list>

      </web-app>

       

      a4j:log shows

       

       

      debug[12:15:30,834]: Append hidden control uploadDoc1 with value [uploadDoc1] and value attribute [uploadDoc1]

       

      debug[12:15:30,849]: Append text control uploadDoc1:fileuploader:file with value [Contact Info3.csv] and value attribute [Contact Info3.csv]

      debug[12:15:30,849]: Append text control uploadDoc1:fileuploader:file with value [] and value attribute []

      debug[12:15:30,849]: Append hidden control javax.faces.ViewState with value [j_id3] and value attribute [j_id3]

      debug[12:15:30,849]: QueryString: AJAXREQUEST=_viewRoot&uploadDoc1=uploadDoc1&uploadDoc1%3Afileuploader%3Afile=Contact%20Info3.csv&uploadDoc1%3Afileuploader%3Afile=&uploadDoc1_link_hidden_=uploadDoc1%3Afileuploader%3AflashContainer&javax.faces.ViewState=j_id3&

      debug[12:15:31,693]: Have Event [object Object] with properties: target: [object], srcElement: [object], type: dataavailable

      debug[12:15:31,693]: Query preparation for form 'uploadDoc1' requested

      debug[12:15:31,693]: Append hidden control uploadDoc1 with value [uploadDoc1] and value attribute [uploadDoc1]

      debug[12:15:31,693]: Append text control uploadDoc1:fileuploader:file with value [] and value attribute []

      debug[12:15:31,693]: Append hidden control javax.faces.ViewState with value [j_id3] and value attribute [j_id3]

      debug[12:15:31,709]: parameter uploadDoc1:j_id27 with value uploadDoc1:j_id27

      debug[12:15:31,709]: Look up queue with default name

      debug[12:15:31,709]: NEW AJAX REQUEST !!! with form: uploadDoc1

      debug[12:15:31,724]: Start XmlHttpRequest

      debug[12:15:31,724]: Request state : 1

      debug[12:15:31,724]: QueryString: AJAXREQUEST=_viewRoot&uploadDoc1=uploadDoc1&uploadDoc1%3Afileuploader%3Afile=&uploadDoc1_link_hidden_=uploadDoc1%3Afileuploader%3AflashContainer&javax.faces.ViewState=j_id3&uploadDoc1%3Aj_id27=uploadDoc1%3Aj_id27&

      debug[12:15:31,818]: Request state : 2

      debug[12:15:31,818]: Request state : 3

      debug[12:15:31,818]: Request state : 4

      debug[12:15:31,818]: Request end with state 4

      debug[12:15:31,818]: Response  with content-type: text/xml;charset=UTF-8

      debug[12:15:31,818]: Full response content: <?xml version="1.0"?><html lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><title></title></head><body><span id="uploadDoc1:msgs">testing</span><meta name="Ajax-Update-Ids" content="uploadDoc1:msgs" /><span id="ajax-view-state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id3" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /><meta name="Ajax-Update-Ids" content="uploadDoc1:msgs" /><span id="ajax-view-state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id3" /></span><meta id="Ajax-Response" name="Ajax-Response" content="true" /></body></html>

      debug[12:15:31,818]: Header Ajax-Expired not found, search in <meta>

      debug[12:15:31,818]: search for elements by name 'meta'  in element #document

      debug[12:15:31,818]: Find <meta name='Ajax-Update-Ids' content='uploadDoc1:msgs'>

      debug[12:15:31,818]: Find <meta name='Ajax-Response' content='true'>

      debug[12:15:31,818]: Find <meta name='Ajax-Update-Ids' content='uploadDoc1:msgs'>

      debug[12:15:31,818]: Find <meta name='Ajax-Response' content='true'>

      debug[12:15:31,818]: Header Ajax-Update-Ids not found, search in <meta>

      debug[12:15:31,818]: search for elements by name 'meta'  in element #document

      debug[12:15:31,818]: Find <meta name='Ajax-Update-Ids' content='uploadDoc1:msgs'>

      debug[12:15:31,818]: Update page by list of rendered areas from response uploadDoc1:msgs

      debug[12:15:31,818]: search for elements by name 'script'  in element #document

      debug[12:15:31,818]: search for elements by name 'link'  in element #document

      debug[12:15:31,818]: call selectSingleNode for id= org.ajax4jsf.queue_script

      debug[12:15:31,834]: Update page part from call parameter for ID uploadDoc1:msgs

      debug[12:15:31,834]: call selectSingleNode for id= uploadDoc1:msgs

      debug[12:15:31,834]: Replace content of node by outerHTML()

      debug[12:15:31,834]: search for elements by name 'script'  in element span

      debug[12:15:31,834]: Scripts in updated part count : 0

      debug[12:15:31,834]: call selectSingleNode for id= org.ajax4jsf.oncomplete

      debug[12:15:31,834]: Processing updates finished, no oncomplete function to call

      debug[12:15:31,834]: Update part of page for Id: uploadDoc1:msgs successful

      debug[12:15:31,834]: call selectSingleNode for id= ajax-view-state

      debug[12:15:31,834]: Hidden JSF state fields:

      debug[12:15:31,834]: Namespace for hidden view-state input fields is undefined

      debug[12:15:31,834]: search for elements by name 'input'  in element span

      debug[12:15:31,834]: Replace value for inputs: 7 by new values: 1

      debug[12:15:31,834]: Input in response: javax.faces.ViewState

      debug[12:15:31,834]: Found same input on page with type: hidden

      debug[12:15:31,834]: Found same input on page with type: hidden

      debug[12:15:31,834]: Found same input on page with type: hidden

      debug[12:15:31,834]: search for elements by name 'INPUT'  in element span

      debug[12:15:31,834]: Replace value for inputs: 7 by new values: 0

      debug[12:15:31,834]: call selectSingleNode for id= _A4J.AJAX.focus

      debug[12:15:31,849]: No focus information in response