Cyrillic + FileUpload + update datatable trouble

UI Components for JSF
Post Reply
loright
Posts: 42
Joined: 10 Aug 2011, 09:55

16 Aug 2011, 18:33

Hello!
I wrote project with fileupload functional, i have button-multi-fileuplode with cyrillic name, when i browse files and click on button-upload with cyrillic label my files uploads and stored in table, after this all files parses and sometimes i have errors in files and when file has errors, in datatable there is a button-single-fileupdate with cyrillic name for reupload files.
1) BUT when i choose some files for upload and upload this files my button multiupload + button for reupload have name such as "???????????", when i press F5, all work good and i can continue work.
2) Also i have a button in datatable, witch show table with errors, if my uploaded files bad. When i do first multiupload, press F5 and want to see errors, press button and see table i see normal table, but if i second time upload some files (or reupload with my single-upload button), files normal add to table, but if i press button to show table with errors, i will see many dialog with table. The number of the traced windows depends on number of the loaded files. I.e. if I have loaded at first 3 files with errors, I can look tables with errors but if I have then finished loading 5 more files by pressing the button of display of the table with errors I will see most likely 6 dialogue windows the friend on the friend. I.e. again to see the main page to me it is necessary to close 6 windows successively. The most interesting that if I after upload these 5 files again I will press F5 all will work well. Prompt, please, that for an outset on this mysterious F5.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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:p="http://primefaces.prime.com.tr/ui" >

<f:view>
<h:body >
 <h:form id="uploadPage" enctype="multipart/form-data" acceptcharset="charset=UTF-8">
     <p:fileUpload id="fileUploader"
                   fileUploadListener="#{fileUploadController.handleFileUpload}"
                   mode="advanced"
                   multiple="true"
                   label = "Cyrillic_choose"
                   uploadLabel = "Cyrillic_upload"
                   cancelLabel = "Cyrillic_calcel"
             />
    <p:dataTable id="table"
                 var="uploadResult"
                 value="#{fileUploadController.results}"
                 dynamic="true">
        <p:column>
            <f:facet name="header">
                <h:outputText value="Cyrillic_file_name" />
            </f:facet>
        </p:column>
        <p:column>
            <f:facet name="header">
                <h:outputText value="Cyrillic_file_type" />
            </f:facet>
        </p:column>

        <p:column>
            <f:facet name="header">
                <h:outputText value="Cyrillic_status" />
            </f:facet>
            <p:fileUpload id="fileReUploader"
                          rendered = "#{uploadResult.upload}"
                          fileUploadListener="#{fileUploadController.reUpload}"

                          label = "Cyrillic_reload"
                          auto="true"
                          value="#{uploadResult}"
                          target="#{fileUploadController.selectedUploadResult}"
                          zindex="#{uploadResult.numberInList}"
                          update="uploadPage"
                          dynamic="true"/>
        </p:column>
        <p:column>
            <f:facet name="header">
                <h:outputText value="Cyrillic_error" />
            </f:facet>
            <h:outputText value="#{uploadResult.errorMessage}" />
                <p:commandButton oncomplete="errorDialog.show()"
                                 title="Cyrillic_detail"
                                 rendered="#{!uploadResult.correctUpload}"
                                 update="errorTable"
                                 image="ui-icon ui-icon-search" >
                    <p:ajax update="errorTable"/>
                    <f:setPropertyActionListener value="#{uploadResult}" target="#{fileUploadController.selectResult}" />
                </p:commandButton>
        </p:column>
    </p:dataTable>
    <p:dialog header="Error Detail" widgetVar="errorDialog" resizable="false" id="errorDlg"
              width="500" showEffect="fade" hideEffect="explode" modal="true" >
        <p:dataTable id="errorTable"
                 var="errors"
                 value="#{fileUploadController.selectResult.errorList}">
            <p:column>
                <f:facet name="header">
                    <h:outputText valueCyrillic_line_number" />
                </f:facet>
                <h:outputText value="#{errors.lineNumber}" />
            </p:column>
            <p:column>
                <f:facet name="header">
                    <h:outputText value="Cyrillic_discription" />
                </f:facet>
                <h:outputText value="#{errors.description}" />
            </p:column>
        </p:dataTable>
    </p:dialog>
 </h:form>
</h:body>
</f:view>
</html>

Primefaces 3.0 m3 + tomcat 7.0.19
Primefaces 3.4 + JBoss 6.1. Final

loright
Posts: 42
Joined: 10 Aug 2011, 09:55

17 Aug 2011, 13:43

I split multiupload-button, table and dialog to 3 forms, and with multiupload work, i update only tableForm, Cyrillic name on multiupload now look normal. But single-upload-button all the same after update tableForm show me "????????" label. Proceeding from it, I consider that upload-button is bad-looking when i handle-update form or table.
Primefaces 3.4 + JBoss 6.1. Final

loright
Posts: 42
Joined: 10 Aug 2011, 09:55

19 Aug 2011, 19:08

I find interesting fact, if i write header of column in a <p:column> in headertext, after update my table, all column headers change name to "?????", after press F5 all will be normal. If i put headers in facet, after update table all will be normal! I think this is bag. May by if i put filupload in facet, it will be defence cyrillic name?! But i can't understand how i do it :( can somebosy help me with facet?
Primefaces 3.4 + JBoss 6.1. Final

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 33 guests