0 Replies Latest reply on Aug 12, 2009 7:25 AM by Jan Winter

    drag n drop sometimes produces: Argument Error: Parameter te

    Jan Winter Newbie

      Hi,

      I'm using drag and drop feature to add/move Images from one place to another. Everything works fine, but sometimes this error occurs when dragging / dropping an image from "availableImagesListScrollerGrid" to "usedImageDropArea":

      12.08.2009 12:24:42 com.sun.facelets.FaceletViewHandler handleRenderException
      SCHWERWIEGEND: Error Rendering View[/WEB-INF/flow/story/editStory.xhtml]
      java.lang.NullPointerException: Argument Error: Parameter text is null
       at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.writeText(HtmlResponseWriter.java:826)
       at org.richfaces.renderkit.DnDParametersEncoder.doEncodeAsMap(DnDParametersEncoder.java:228)
       at org.richfaces.renderkit.DnDParametersEncoder.doEncodeAsString(DnDParametersEncoder.java:130)
       at org.richfaces.renderkit.html.DragSupportRenderer.encodeEnd(DragSupportRenderer.java:95)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861)
       at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:281)
      
      ....
      
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Unknown Source)
      


      XHTML Code:
      <rich:tab label="Bildergalerie">
       <rich:panel>
       <f:facet name="header">
       <h:outputText value="Bildergalerie für diese Seite" />
       </f:facet>
      
       <rich:panel>
       <f:facet name="header">
       <h:outputText value="Bilder die für diese Seite angezeigt werden sollen" />
       </f:facet>
       <rich:dropSupport id="usedImageDropArea"
       acceptedTypes="imageAvail"
       dropListener="#{StoryBB.processAddImageForGallery}"
       reRender="usedImagesListScrollerGrid, availableImagesListScrollerGrid"
       immediate="true"/>
       <rich:dataGrid id="usedImagesListScrollerGrid" value="#{actSoStory.soImages}"
       var="usedImage"
       columns="5"
       elements="10"
       styleClass="top">
      
       <a4j:outputPanel layout="block">
       <rich:dragSupport dragIndicator=":indicator"
       dragValue="#{usedImage}"
       dragType="removeImage">
       <rich:dndParam name="label" value="#{usedImage.imageName}" />
       <rich:panel>
       <f:facet name="header">
       <h:outputText value="#{usedImage.imageName}" style="font-size: 7pt;" />
       </f:facet>
       <h:graphicImage width="140px;" value="#{pathValues.imagePath}#{usedImage.imagePath}#{usedImage.imageSmall}"/>
       </rich:panel>
       </rich:dragSupport>
       </a4j:outputPanel>
       <f:facet name="footer">
       <rich:datascroller for="usedImagesListScrollerGrid" maxPages="10" pageIndexVar="pageIndex" pagesVar="pages" immediate="true"
       limitToList="true"
      reRender="usedImagesListScrollerGrid"/>
       </f:facet>
       </rich:dataGrid>
       </rich:panel>
      
       <f:verbatim>
       <p>
       Bilder per Drag und Drop von <b>unten nach oben ziehen</b>, um sie der Bildergalerie für diesen Text hinzuzufügen.<br/>
       Um Bilder wieder aus der Galerie zu entfernen einfach von wieder zurück von <b>oben nach unten ziehen</b>.
       </p>
       </f:verbatim>
      
       <rich:panel>
       <f:facet name="header">
       <h:outputText value="Verfügbare Bilder" />
       </f:facet>
       <rich:dropSupport id="availImagesDropArea"
       acceptedTypes="removeImage"
       dropListener="#{StoryBB.processRemoveImageForGallery}"
       reRender="availableImagesListScrollerGrid, usedImagesListScrollerGrid" immediate="true">
       <rich:dataGrid id="availableImagesListScrollerGrid" value="#{AvailableSoImageExtendedDataModel}"
       var="avImage"
       columns="5"
       elements="10"
       styleClass="top" >
       <f:facet name="header">
       <rich:datascroller for="availableImagesListScrollerGrid" maxPages="15" pageIndexVar="pageIndex" pagesVar="pages"
      immediate="true" limitToList="true" reRender="availableImagesListScrollerGrid"/>
       </f:facet>
      
       <a4j:outputPanel layout="block">
       <rich:dragSupport dragIndicator=":indicator"
       dragValue="#{avImage}"
       dragType="imageAvail"
       rendered="#{!snow:inSoImages(actSoStory.soImages,avImage)}">
       <rich:dndParam name="label" value="#{avImage.imageName}" />
       <rich:panel>
       <f:facet name="header">
       <h:outputText value="#{avImage.imageName}" style="font-size: 7pt;" />
       </f:facet>
       <h:graphicImage width="140px;" value="#{pathValues.imagePath}#{avImage.imagePath}#{avImage.imageSmall}"/>
       </rich:panel>
       </rich:dragSupport>
       </a4j:outputPanel>
       </rich:dataGrid>
       </rich:dropSupport>
       </rich:panel>
      
       </rich:panel>
       </rich:tab>
      


      I just don't know why this error happens und I can't find the component which produces it. Is it made by dropSupport, dragSupport, dndParam or even a4j:outputPanel or something I didn't think of??

      The error is about a NullpointerException, but no matter which value/object I think of - everything is filled with data. So there is no text/string attribute which could be null. ...as far as I can think of ;)

      I'm using: RichFaces richfaces 3.3.2-20090731

      Please help me out of this :)

      Jan