myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey P." <ural...@list.ru>
Subject Problem with t:inputFileUpload in one page with t:dataScroll (form with enctype="multipart/form-data")
Date Tue, 03 Jun 2008 08:12:09 GMT

Hi all! Need help with a simple form, which has one dataTable with
dataScroller and uses .csv file as an input.

FileUpload and others is from Tomahawk, and no AJAX is used for it.
The exception occurs on submit when the file is uploaded.

" Exception while calling encodeEnd on component : {Component-Path : [Class:
org.ajax4jsf.component.AjaxViewRoot,ViewId: /secure/IpResolver.jsp][Class:
javax.faces.component.html.HtmlPanelGrid,Id: j_id_jsp_1520923443_12]}

Caused by:
java.lang.IllegalArgumentException - could not find UIData referenced by
attribute dataScroller@for = 'resolveDataTable' "

Seems like the problem is with searching a dataTable component by Id.

I tried to use two forms: the first with "multipart/form-data" encoding type
- for the uploading, and the other with "application/x-www-form-urlencoded"
for the rest, or just one form - and the result was the same. Exception on
RenderResponse while processing the submit() of form with
"multipart/form-data".

Did anyone had such problems? What am I doing wrong?

P.S. In all the other pages dataTables with scrollers and all the others
work fine.
The exception is thrown only on uploaded file submit %(.
"web.xml" contains nothing unusual; forcedId="true" didn't help in this
case.

Here is some code: 

page fragment:
...
 <t:inputFileUpload id="fileUploaderInput"
                                   accept="application/csv"
                                   value="#{uploadedFile.upFile}" 
                                   storage="file" 
                                   styleClass="fileUploadInput"
                                   required="true" 
                                   maxlength="200000" 
                                  
title="#{strings['forms.file_upload_title']}" 
                                   size="30" >
                </t:inputFileUpload>
                
                <h:commandButton type="submit" 
                                
value="#{strings['forms.button.file_upload']}"
                                 actionListener="#{uploadedFile.upload}" />
...
                <h:panelGroup>
                    <t:dataTable id="resolveDataTable" 
                                 styleClass="scrollerTable"
                                 headerClass="standardTable_Header"
                                 footerClass="standardTable_Header"
                                
rowClasses="standardTable_Row1,standardTable_Row2"
                                 columnClasses="standardTable_Column"
                                 var="resolving"
                                 value="#{uploadedFile.resolvings}"
                                 first="#{uploadedFile.first}"
                                 preserveDataModel="true"
                                 rows="#{uploadedFile.rows}"
                                 rowId="#{resolving.key}"
                                
rowOnMouseOver="this.className='standardTable_Row_MouseOver'"
                                
rowOnMouseOut="this.className='standardTable_Row_MouseOut'"
                                
rowOnClick="this.className='standardTable_Row_MouseClick'"
                                
rowOnDblClick="this.className='standardTable_Row_MouseDoubleClick'" >
                        
                        <h:column>
                            <f:facet name="header">
                                <h:outputText
value="#{strings['forms.ip_resolver.key']}" />
                            </f:facet>
                            <h:outputText value="#{resolving.key}" />
                        </h:column>
                        <h:column>
                            <f:facet name="header">
                                <h:panelGrid width="420">
                                    <h:outputText
value="#{strings['forms.ip_resolver.value']}" />
                                </h:panelGrid>
                            </f:facet>
                            <h:outputText value="#{resolving.value}" />
                        </h:column>
                    </t:dataTable>
                    
                    <t:dataScroller id="resolveScroller"
                                    for="resolveDataTable"
                                    fastStep="10"
                                    rowsCountVar="rowsCount"
                                   
displayedRowsCountVar="displayedRowsCountVar"
                                    firstRowIndexVar="firstRowIndex"
                                    lastRowIndexVar="lastRowIndex"
                                    pageCountVar="pageCount"
                                    pageIndexVar="pageIndex"
                                    renderFacetsIfSinglePage="false"
                                    styleClass="scroller"
                                    paginator="true"
                                    paginatorMaxPages="9"
                                    paginatorTableClass="paginator"
                                   
paginatorActiveColumnStyle="font-weight:bold;"
                                    immediate="true">
                        <f:facet name="first" >
                            <t:graphicImage
url="images/tables/arrow-first.gif" border="1" />
                        </f:facet>
                        <f:facet name="last">
                            <t:graphicImage
url="images/tables/arrow-last.gif" border="1" />
                        </f:facet>
                        <f:facet name="previous">
                            <t:graphicImage
url="images/tables/arrow-previous.gif" border="1" />
                        </f:facet>
                        <f:facet name="next">
                            <t:graphicImage
url="images/tables/arrow-next.gif" border="1" />
                        </f:facet>
                        <f:facet name="fastforward">
                            <t:graphicImage url="images/tables/arrow-ff.gif"
border="1" />
                        </f:facet>
                        <f:facet name="fastrewind">
                            <t:graphicImage url="images/tables/arrow-fr.gif"
border="1" />
                        </f:facet>
                    </t:dataScroller>
                </h:panelGroup>
...

web.xml fragment:
    <context-param>
        <param-name>com.sun.faces.verifyObjects</param-name>
        <param-value>false</param-value>
    </context-param>
    <context-param>
        <param-name>com.sun.faces.validateXml</param-name>
        <param-value>true</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
    </context-param>
    
    
    <context-param>
        <param-name>org.richfaces.SKIN</param-name>
        <param-value>blueSky</param-value>
    </context-param>
    
    <filter> 
        <display-name>RichFaces Filter</display-name> 
        <filter-name>richfaces</filter-name> 
        <filter-class>org.ajax4jsf.Filter</filter-class> 
    </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>

    <filter>
        <filter-name>extensionsFilter</filter-name>
       
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
        <init-param>
            <param-name>uploadMaxFileSize</param-name>
            <param-value>100m</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>extensionsFilter</filter-name>
        <url-pattern>/faces/*</url-pattern>
    </filter-mapping>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>2</load-on-startup>
    </servlet>
-- 
View this message in context: http://www.nabble.com/Problem-with-t%3AinputFileUpload-in-one-page-with-t%3AdataScroll-%28form-with-enctype%3D%22multipart-form-data%22%29-tp17618380p17618380.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Mime
View raw message