PrimeFaces fileupload ie9 not multiple select - jsf

PrimeFaces 4.0 FileUpload multiple="true" but i am not selection multiple. only one file select.
it is work in chrome but is not work ie9. Why?
xhtml
<p:dialog id="DosyaDlg" widgetVar="DosyaDialog" modal="true" resizable="false" appendTo="#(body)" header="#{msg['header.dialog.dosyaEkle']}" closeOnEscape="true">
<h:form id="DosyaForm" enctype="multipart/form-data">
<p:fileUpload fileUploadListener="#{yazilimArizaBean.dosyaYenile}" dragDropSupport="false" fileLimit="3" sizeLimit="1000000" mode="advanced" multiple="true" uploadLabel="#{msg['button.yukle']}"
cancelLabel="#{msg['button.iptal']}" description="Select Images" label="#{msg['button.sec']}" allowTypes="/(\\.|\\/)(doc|docx|xls|xlsx|ppt|pptx|txt|png)$/" oncomplete="DosyaDialog.hide()" />
</h:form>
</p:dialog>
Thank you for your helps

Seems like IE9 does not support multiple File Upload from Primefaces post v2.2.1 (meaning your v4.0 is included in the non-working ones).
See issue here : https://code.google.com/p/primefaces/issues/detail?id=3869
This will not get fixed.

Related

Primefaces editor is disabled after minimizing the dialog

I have p:editor inside my dialog. when i minimize and restore the dialog again, the data in editor is gone and editor is disabled. Below is the xhtml code
<p:dialog closeOnEscape="true" responsive="true" widgetVar="dlg" id="dlg1" resizable="false" draggable="true" closable="true" dynamic="true" modal="false" width="97%" minimizable="true" appendTo="#(body)" header="Dialog" onShow="PF('dlg').initPosition()">
<pe:ckEditor toolbar="#{config['ckEditor.toolBar']}" id="body" widgetVar="editor" readonly="false" width="100%" maxlength="50000" value="#{myBean.textVal}" />
</p:dialog>
i have tried both primefaces editor and primefaces ckEditor but facing same issue on both.
currently using:
primefaces-6.1
primefaces-extensions-6.1.1
jsf-2.2
Edit: i have downloaded primefaces showcase and having the same issue on showcase too. Below is the code snippet.
<p:dialog minimizable="true" modal="false" id="newDlg" widgetVar="dlgNew">
<p:editor value="test"/>
</p:dialog>
Screenshot1: Dialog when initial load.
initial load
Screenshot2: Disabled dialog after minimizing and restoring on firefox
Dialog on firefox
Screenshot3: Disabled dialog after minimizing and restoring on chrome
Dialog on chrome
apparently, it's a primefaces defect. you can check it
here. Hopefully it will be fixed soon.

Required message not showing for p:fileUpload after using Primefaces 5.0

Earlier I used primefaces 3.5 to show required message for p:fileUpload and that time it was showing on my website. As I upgraded to primefaces 5.0 required message for p:fileUpload is not shown. Below is the code :
<h:form id="uploadPForm" class="form-horizontal row-border" enctype="multipart/form-data">
<span>
<p:messages autoUpdate="false" closable="true" id="msgsuccess" severity="info"/>
<p:messages autoUpdate="false" closable="true" id="msgerror" severity="fatal,error"/>
</span>
<p:fileUpload id="appUpload" mode="simple"
required="true requiredMessage="#msg['appUpload.Required']}"
value="#{appUploadBean.file}" style="width:228px;">
</p:fileUpload>
</h:form>

File upload with advanced mode not working

I'm trying to add advanced mode of FileUpload in Appfuse project and i followed this link: http://www.primefaces.org/showcase/ui/file/upload/multiple.xhtml.
I add it but when in choose my files, there is no files displayed in growl tag and the upload and cancel button steel disable.
In the terminal of my navigator i have this error : TypeError: undefined is not a function.
Can you help me plzz
Thanks
the showcase has a bug
you you need to declare enctype with the value multipart/form-data
Example
<h:form enctype="multipart/form-data">
<p:growl id="messages" showDetail="true" />
<p:fileUpload fileUploadListener="#{fileUploadView.handleFileUpload}" mode="advanced" dragDropSupport="false"
multiple="true" update="messages" sizeLimit="100000" fileLimit="3" allowTypes="/(\.|\/)(gif|jpe?g|png)$/" />
<p:growl id="messages" showDetail="true" />
</h:form>

JSF: Dynamic include page into primefaces dialog

I want to include the content of a primefaces dialog from another page with ui:include. The included page must be set dynamic depending on which button user clicked. I used the very helpful answer from BalusC from JSF dynamic include using Ajax request.
It works very fine as in the example. But problems come if I use a p:dialog instead of h:panelGroup:
<h:form>
<f:ajax render=":dialog">
<p:commandButton value="page1" action="#{productBean.setDialogPage('/page1.xhtml')}" oncomplete="dialogWidget.show()"></p:commandButton>
<p:commandButton value="page2" action="#{productBean.setDialogPage('/page2.xhtml')}" oncomplete="dialogWidget.show()"></p:commandButton>
</f:ajax>
</h:form>
<p:dialog id="dialog" widgetVar="dialogWidget" >
<ui:include src="#{productBean.dialogPage}" />
</p:dialog>
1st problem: Sometimes, I have to click a button several times before dialog appears. It seems not to follow any pattern but is a random effect. Sometimes I need to click twice, sometimes I need to click four times on the button.
2nd problem: Sometimes, the dialog appears not with the selected page but with the old one. When I close dialog and select again, the current page is loaded. It seems to be a random effect, too.
Why do I get this problems with dialog?
hy,
i don't know why you are using this mode to display dynamique dialog,
for me, i like use this mode:
<h:form>
<p:commandButton value="page1"
actionListener="#{productBean.setDialogPage('page1')}" oncomplete="PF('dialogWidget').show()" update="dialog"/>
<p:commandButton value="page2"
actionListener="#{productBean.setDialogPage('page2')}" oncomplete="PF('dialogWidget').show()" update="dialog"/>
</h:form>
<p:dialog id="dialog" widgetVar="dialogWidget">
<ui:include src="/#{productBean.dialogPage}.xhtml" />
</p:dialog>
and:
page1.xhtml
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:form>
<!-- your code -->
</h:form>
</ui:composition>
it's working fine :)
If you reverse engineer existing tables with Netbeans 8 (generate entities + generate jsf pages), it will do something very similar out of the box; on the list page there is a create-button, which shows a dialog included from another page. You should try it, be sure to select "primefaces" in the last page in the guide for generating jsf pages. They do it like this:
List.xhtml:
<p:commandButton id="createButton" icon="ui-icon-plus" value="#{bundle.Create}" actionListener="#{kornstoranalyseStdController.prepareCreate}" update=":KornstoranalyseStdCreateForm" oncomplete="PF('KornstoranalyseStdCreateDialog').show()" />
Create.xhtml is included with <ui:include src="Create.xhtml"/> below </h:form> in the list-page.
Create.xhtml starts with:
<ui:composition>
<p:dialog id="KornstoranalyseStdCreateDlg" width="500px" widgetVar="KornstoranalyseStdCreateDialog" modal="true" resizable="true" showEffect="clip" appendTo="#(body)" header="#{bundle.CreateKornstoranalyseStdTitle}" hideEffect="clip" position="top">
<h:form id="KornstoranalyseStdCreateForm">
Hopefully you can tweak to suit your needs.

Primefaces DataGrid - CommandLink is not working

i have an issue with nested UI components which is probably a known bug in PrimeFaces and Mojara. However I have no idea how can i solve it.
We have a image gallery with uploader and I want to be able to delete images from the datagrid, so
XHTML:
<h:form enctype="multipart/form-data">
<p:fileUpload fileUploadListener="#{pictureManagementBean.handleFileUpload}"
mode="advanced"
update="gallery messages"
auto="true"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/"
/>
<p:growl id="messages" showDetail="true"/>
<p:dataGrid var="item" value="#{pictureManagementBean.pictures}" id="gallery">
<p:panel header="#{item.pictureName}" style="text-align:center">
<h:panelGrid columns="1" style="width:100%">
<p:graphicImage value="#{item.thumbnailDir}" />
<h:outputText value="#{item.createdate.toString()}" />
<p:commandLink value="Delete"
action="#{pictureManagementBean.removePicture(item.idpicture)}" ajax="false"/>
</h:panelGrid>
</p:panel>
</p:dataGrid>
</h:form>
Basically what is not working at the momment - at all - is the commandLink Delete in the DataGrid. The rest is fine.
Is there any walkaround to this? I've tried: columns, ajax, no ajax... nothing works. All i can do is get the button outside the DataGrid. But that's not really what I want.
Any help apprecieated.
[small thing: surprisingly I have used commandLink in DataTable and Columns with no problem! ]
Primefaces 3.4RC1 from maven. (didnt work on 3.3.1 either)
ok so I've found one thing:
inside <p:dataGrid> if I use anything BUT p:columns its not working.
But then the view is terrible... should I just use CSS to fix it?
#Maple_shaft you are so right!
correct code:
<p:dataGrid var="item" value="#{pictureManagementBean.pictures}" id="gallery">
<p:column>
<p:panel header="#{item.pictureName}" style="text-align:center">
<h:panelGrid columns="1" style="width:100%">
<p:graphicImage value="#{item.thumbnailDir}" />
<h:outputText value="#{item.createdate.toString()}" />
<p:commandLink value="Delete"
action="#{pictureManagementBean.removePicture(item.idpicture)}" ajax="false"/>
</h:panelGrid>
</p:panel>
</p:column>
</p:dataGrid>
So just simple column element. I've just places it wrong before. Thanks so much.
Of course backing bean is #ViewScoped!

Resources