Problem with t:inputFileUpload in one page with t:dataScroll
psw Jun 2, 2008 10:40 AMHi all! Need help with a simple form, which has one dataTable with scroller and uses csv file as an input.
FileUpload 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.
Did anyone have such problems? What am I doing wrong?
Here is some code:
<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>