FileLimit is not working in primefaces file upload when multiple="true" - file-upload

I trying to set fileLimit="4" in my application in <p:fileUpload> to validate when user uploads multiple files but not more than four. But this is not working.
When I checked primefaces showcase for this multiple=true scenario, there also not working. And the most weird thing is when I try to autocomplete in eclipse for the attributes inside <p:fileUpload> I don't see any fileLimit, fileLimitMessage etc. I am using Primefaces 3.5v.Is this a bug in Primefaces file upload?

For some reason, PrimeFaces main showcase site is showcasing current alpha/beta/RC version instead of latest stable version. You can verify this by looking at the version information in the footer of the showcase site. This is indeed confusing. Previously, all PrimeFaces alpha/beta/RC versions were showcased on a different showcase site (called PrimeFaces labs).
In your particular case, the fileLimit attribute of <p:fileUpload> is indeed added in PrimeFaces 4.0 and absent in 3.5. In order to utilize this attribute, you'd need to upgrade to PrimeFaces 4.0. It's currently only available as a snapshot (note: you're supposed to report all issues directly to them then). The final release is scheduled in a few weeks.

Related

Overriding Dojo version for a particular Xpages database

Apple's iOS 8 breaks certain tap functionality in versions of dojo prior to 1.9.4 (see Xpages mobile controls not working in iOS8
The current version of Dojo in Domino 9.0.1 FP2 is 1.9.2 but that does not fix the issue. You have to use at least 1.9.4.
I have downloaded 1.9.4 and placed it in the correct folder on our test server. But I cannot get things to work. I changed the folder name of dojo 1.9.4 to 1.4.0 as I only want to use this version for 2 dbs that are having the problem.
Question 1:
What line do I put in the xsp.properties file:
xsp.client.script.dojo.version = 1.4.0
xsp.client.script.dojo.path = / domjs / dojo-1.4.0
Question 2:
There are so many things to download when I go to the dojo download page. I downloaded the zip file and used that.
When I run code to test what version of dojo I have I get 1.9.4. But when I try to load my page, I get an error.
dojo._loaders: TypeError: dojo._loaders is undefined
Any help would be GREATLY appreciated.
You probably have the right dojo zip, this one: http://download.dojotoolkit.org/release-1.9.4/dojo-release-1.9.4.zip. As you say, unzip that to the dojo-1.9.4 folder in <server-install>\data\domino\js\, or name the folder 1.4.0 if you want to specify it for only a few apps.
You will indeed need to copy the IBM folder from the <server-install>\osgi\shared\eclipse\plugins\com.ibm.xsp.dojo_9.0.1.<date-stamp>\xsp.dojo.jar into your new 1.9.4 (or 1.4.0) dojo folder. Little chance of anything working without it. Copying the ibm folder from the 1.5.2 folder is a bad idea as that is old code, and you'd certainly have issues with it working with dojo 1.9.4. In Fix Pack 2, the ibm folder from the plugin was tested/designed to work with dojo 1.9.2 (the version in that jar), so it should play fairly nice with 1.9.4.
In your XPages app, in the xsp.properties, you should only need the line:
xsp.client.script.dojo.version = 1.9.4
Rebuild your app, restart the server etc, and you should be good to go.
DISCLAIMER: This is a work-around, not a supported solution by IBM. There may be unexpected issues using this approach. It's used at your own risk.
You commented already on that topic here so I think you tried this one? http://hasselba.ch/blog/?p=323
This is the SO thread: XPages mobile controls not working with iOS 8

jsf 2.1 cant import <h:inputfile

I am trying to add to my site the tag
I have completed my site under java EE 7 jsf 2.2 and primefaces 4.0 and was working under glassfish 4 but my production envireoment will have jboss and i noticed that there is not available the java EE 7 on this application Server, so i downgrade my site to java EE and this lead me use jsf 2.1
The problem i am facing now is that i have problems with the rendering items. specially with forms that have input file tags as i get the error
<h:inputFile> Tag Library supports namespace: http://java.sun.com/jsf/html, but no tag was defined for name: inputFile
If i remove this the rest page works, is rendered at browser but still does not work as it should be.
in pages that i have to render differente panelgroups (with primefaces tags inside) they are rendered but the broswer hit alerts
malformedXML: During update: javax.faces.ViewState not found
i cant understand why this is happening.
I need to fix this problem an make available to my pages the inputfile tag.
If i use primefaces inputfile still the page does not work as the render stop works at all
<h:inputfile> is JSF 2.2 specific tag and is not available in JSF 2.1. But you can use upload component provided by component libraries. As you are already using primefaces, use their component.
Although this question has an accepted answer, it is not always possible to use upload components from a specific component suite. Especially not if you already use another one. Many of them use e.g. jquery under the hood and unfortunately not in a no-conflict mode. A still valid alternative then is to use the solution from BalusC: http://balusc.omnifaces.org/2009/12/uploading-files-with-jsf-20-and-servlet.html
FileUpload from Primefaces has errors and it seems that there are no plans to fix it, you can only upload the first file in each upload.

org.eclipse.search.internal.ui.searchpreferencepage.java is not available on eclipse 3.7.2

I could not find org.eclipse.search.internal.ui.searchpreferencepage.java in eclipse 3.7.2 version.It was available on eclipse 3.2.2. Can any one help me on finding that why this class has been removed from latest version and is there any alternative for this class on new version.
Is there any limit related methods on eclipse 3.7.2 plugins?
This is an internal class and consequently is not part of the Eclipse API and is subject to change without notice (see Eclipse API Rules of Engagement).
However it is still present in Eclipse 4.3 but is marked x-internal:=true in the Export-Package in the MANIFEST.MF. It is also present in Eclipse 3.8, in both cases in the org.eclipse.search plug-in.
The table limits which used to be in the preference page were removed some time ago, probably when the option to show the results in a tree was added.
Edit:
Further research shows the limit was moved from the preferences page to the Search Filters dialog in the drop down menu of the search view. The limit configured here can be accessed using the getElementLimit() method of org.eclipse.search.ui.text.AbstractTextSearchViewPage
getElementLimit() returns null if there is no limit.

Adding Dojo 1.6+ in Lotus Notes database v8.5.3

Lotus Notes 8.5.3 uses dojo 1.5.1. However I want to use dojo 1.6/1.7 library in my NSF database. How can I do it? I tried to use the technique suggested by Keith Strickland in his blog but no luck.
I need to include the dojo library in NSF database and not on server.
The reason I want to do this so as to use the advanced Dojo Mobile libraries (from dojo 1.6/1.7) in my XPages.
UPDATE: I even posted this question on XPages forum some time back but no replies.
The Domino 8.5.3 server uses Dojo 1.6.1 for XPages. You should see this if you view the HTML source of a test application.
As an example, I see this in one of my applications:
"/xsp/.ibmxspres/dojoroot-1.6.1/dojo/dojo.js"
If you are going to create apps using Dojo Mobile then take a look at the Extension Library and the latest Upgrade Pack 1 for Domino 8.5.3. Both includes XPages Mobile controls.
Per's correct that the Dojo plugin that is loaded by default is 1.6.1 (the ".1" is because it includes IBM-specific code and this means it differentiates it from anything a developer has added in).
The files in the js folder on the server / client are 1.5.1 and this is needed for iNotes.
You can change the Dojo version in the xsp.properties by setting xsp.client.script.dojo.version in Package Explorer. Incidentally UP1 offers a nice visual editor for the xsp.properties file.
However, currently if you change this setting you need to uncheck "Use runtime optimized javaScript and CSS resources" or it will still use the plugin. I noticed this too late for anything to be done before the Gold release.
If you add 1.7 files to the server and include the IBM folder from 1.5.1 it may work. AFAIK there's no way to get the IBM folder from the plugin code.
See my blog post for more details: http://www.intec.co.uk/domino-8-5-3-greater-power-over-dojo-thanks-ibm-for-your-work/

Is the latest Dojo 1.6.1 included in the Google Libraries?

When i try to use the statement google.load("dojo", "1.6.1") in a web app I am developing, I receive the error:
Module: 'dojo' with version '1.6.1' not found!
This latest version of dojo, enables a certain amount of support for IE 9.0, and that is why I need to reference it. Is this supported by Google as a library? Either way, if anyone has suggestions as to how I can work around this?
1.6.1 is not yet in the Google ajax library repositories. See the latest version note here. I'm sure it will be within a day or two. There is a note on the dojo download page in big red letters saying that the CDN's are still behind on 1.6.0 and saying where to get notified when they are updated.
You can always use the "1.6" nomenclature to always have the latest version and your app will move up to 1.6.1 as soon as it hits the Google CDN. If a couple days is really going to make or break you you should consider compiling and using your own local version. Dojo makes this really easy.