Fileupload and ListShuttle in a tab panel causes NPE in
ListShuttleRendererBase.encodeOneRow
--------------------------------------------------------------------------------------------
Key: RF-5596
URL:
https://jira.jboss.org/jira/browse/RF-5596
Project: RichFaces
Issue Type: Bug
Affects Versions: 3.3.0
Environment: Vista x64, JSF 1.2_10, RF 3.3.0 CR1, JDK6
Reporter: Jonathan Moores
The below faces page causes the following stack error.
IE seems to be ok.
Safari and FF3 have issues.
STACK::
Caused by: java.lang.NullPointerException
at
org.richfaces.renderkit.ListShuttleRendererBase.encodeOneRow(ListShuttleRendererBase.java:158)
at org.richfaces.renderkit.AbstractRowsRenderer.process(AbstractRowsRenderer.java:86)
at org.richfaces.model.ListShuttleDataModel$1.process(ListShuttleDataModel.java:84)
at org.ajax4jsf.model.SequenceDataModel.walk(SequenceDataModel.java:101)
at org.richfaces.model.ListShuttleDataModel.walk(ListShuttleDataModel.java:78)
at org.ajax4jsf.component.UIDataAdaptor.walk(UIDataAdaptor.java:1151)
at
org.richfaces.renderkit.AbstractRowsRenderer.encodeRows(AbstractRowsRenderer.java:106)
at
org.richfaces.renderkit.ListShuttleRendererBase.encodeRows(ListShuttleRendererBase.java:116)
at
org.richfaces.renderkit.html.ListShuttleRenderer.doEncodeChildren(ListShuttleRenderer.java:267)
at
org.richfaces.renderkit.html.ListShuttleRenderer.doEncodeChildren(ListShuttleRenderer.java:257)
at
org.richfaces.renderkit.ListShuttleRendererBase.encodeChildren(ListShuttleRendererBase.java:244)
PAGE:::
<%@ taglib prefix="rich"
uri="http://richfaces.ajax4jsf.org/rich"
%>
<%@ taglib prefix="h"
uri="http://java.sun.com/jsf/html" %>
<%@ taglib prefix="f"
uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="a4j"
uri="http://richfaces.org/a4j" %>
<%@ page contentType="text/html;charset=UTF-8" language="java"
%>
<html>
<head><title>Simple jsp page</title></head>
<body>
<f:view>
<a4j:form id="newDocumentForm">
<h:panelGrid columns="3">
<a4j:commandLink id="saveButton"
actionListener="#{documentBean.saveDocument}"
styleClass="linkButton"
reRender="newDocumentTabPanel">
<h:outputText value="Click"/>
</a4j:commandLink>
</h:panelGrid>
<rich:tabPanel id="newDocumentTabPanel" switchType="ajax"
style="width: 700px; height: 500px;"
binding="#{documentBean.tabPanel}"
selectedTab="#{documentBean.selectedTab}">
<rich:tab id="customerTab" label="Customers">
<a4j:outputPanel ajaxRendered="true">
<rich:listShuttle id="customerListShuffle"
sourceValue="#{documentBean.availableCustomers}" rows="25"
listsHeight="150"
targetValue="#{documentBean.current.customers}" var="customer"
sourceCaptionLabel="Available Customers"
targetCaptionLabel="Assigned Customers"
orderControlsVisible="false"
converter="customerConverter">
<rich:column visible="false">
<h:outputText value="#{customer.custId}"/>
</rich:column>
<rich:column>
<h:outputText value="#{customer.custName}"/>
</rich:column>
</rich:listShuttle>
</a4j:outputPanel>
</rich:tab>
<rich:tab id="attachmentTab" label="Attachments">
<h:panelGrid columns="2" columnClasses="top,top">
<rich:fileUpload
fileUploadListener="#{documentBean.uploadFileListener}"
maxFilesQuantity="20"
id="uploadPanel"
autoclear="true"
noDuplicate="true"
immediateUpload="true"
acceptedTypes="*"
allowFlash="false"
<a4j:support
event="onuploadcomplete" reRender="uploadedFileList, messages"/>
<f:facet name="label">
<h:outputText value="{_KB}KB from {KB}KB uploaded :[
{mm}:{ss} ]"/>
</f:facet>
<f:facet name="header">
<h:outputText value="Uploaded Files Info"/>
</f:facet>
</rich:fileUpload>
<h:panelGroup>
<rich:panel id="uploadedFileList">
<h:outputText value="No files currently uploaded"
rendered="#{documentBean.attachmentCount==0}"/>
<rich:dataGrid columns="1"
value="#{documentBean.attachments}"
var="attachment"
rowKeyVar="row">
<rich:panel>
<h:panelGrid columns="2">
<h:panelGrid columns="2">
<h:outputText value="File
Name:"/>
<h:outputText
value="#{attachment.name}"/>
<h:outputText value="File
Length(bytes):"/>
<h:outputText
value="#{attachment.length}"/>
</h:panelGrid>
</h:panelGrid>
</rich:panel>
</rich:dataGrid>
</rich:panel>
<rich:spacer height="3"/>
<br/>
<a4j:commandButton
actionListener="#{documentBean.clearUploadedAttachments}"
reRender="uploadedFileList, uploadPanel"
value="Clear Uploaded Data"
rendered="#{documentBean.attachmentCount>0}"/>
</h:panelGroup>
</h:panelGrid>
</rich:tab>
</rich:tabPanel>
<rich:messages/>
<%--<a4j:log level="ALL" popup="false"/>--%>
</a4j:form>
</f:view>
</body>
</html>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira