JSF form with file upload and multiple select capabilities - file-upload

I am using JSF 2.0, and I have a form with a primefaces autoComplete (multiple) field, and a couple of file inputs. Since I'm using a file input, my h:form tag uses enctype="multipart/form-data" .
However, when I set my form to be multipart, my autocomplete field only returns the last item to my bean (the list is always of size 1). This issue also occurs when just using a regular multiple select element instead of the primefaces autocomplete (the autocomplete makes use of a hidden multiple select element). When I remove enctype="multipart/form-data", this issue goes away, but of course, my bean cannot detect the files I wish to upload.
Has anyone faced this issue and found a solution?
I am using: Liferay 6.1 GA2, Primefaces 3.5, Mojarra 2.1.21

Anghel Leonard describes in article Uploading multiple files using pass through namespace (http://xmlns.jcp.org/jsf/passthrough) to add multiple attribute and overriding FileRenderer#decode method to extract uploaded files.

I had the same problem with JBoss EAP 6.1. Turns out it's a bug in the implementation of the Request.java object which isn't fixed until Wildfly 8.x. Reference here: https://community.jboss.org/thread/223085
To get around this, I used a filter from BalusC's blog: http://balusc.blogspot.com/2007/11/multipartfilter.html
Note that even though JBoss is a 3.0 servlet spec, I couldn't use BalusC's related blog entry for 3.0 because of the bug.

To anyone who is facing this issue, I would just like to share that I eventually turned to using jquery's autocomplete widget instead.

Related

Dojo Image Indicator while partial refresh not working in Notes 9

I am helping a co-worker with a issue in a production datatbase. The database makes use of a visual indicator to show the user during long partial refreshes. We are in the process of upgrading the application to Notes 9.0.1.
The method that is used is described in detail in this blog post by Eric Tomenga: https://www.socialbizug.org/blogs/tomenga/entry/dojo_loading_image_indicator_while_partial_refresh_loads_data?lang=en_us (blog that Eric's references appears to be offline)
The code is not altered from what is shown in the post. Works in 8.5.3 completely, but in 9.0.1, the "Please Wait" works but the spining image is absent.
My suspicion is that newer dojo version that Notes 9 uses changes something that breaks this. Downgrading dojo versions is not an option. Hoping for a workaround.
<xp:this.onStart><![CDATA[XSP.startAjaxLoading()]]></xp:this.onStart>
<xp:this.onComplete><![CDATA[XSP.endAjaxLoading()]]></xp:this.onComplete>
<xp:this.onError><![CDATA[XSP.endAjaxLoading()]]></xp:this.onError>
This is added to the element you want to use it with (button in this case). The following dojo modules are added to XPage resources: extlib.dijit.ExtLib + extlib.dijit.Loading
I'm pretty sure you'll need to add the relevant Dojo module as well. You can see a working example of the code on the Admin page of the XPages Extension Library demo database. I can't remember off-hand which dojo module it is, so please post here if that solves it.

Tree-View LINKING in Doxygen

In DOXYGEN, initially before Generate_TreeView is checked (i.e, when disabled), when I click on the side function choosing pane, I get the correct documentation of the function. But after Generate_TreeView is checked and when clicked on any function to view its corresponding documentation it shows the File reference instead of documentation. One thing to be noted is : I am generating separate member pages for all the functions.
I got the solution !! Make sure you have checked "SEPARATE_MEMBER_PAGES" in DOXY-Wizard !! I had the following issue in DOYGEN 1.8.4 but once I started using DOXYGEN 1.8.7, the issue got resolved !! Just a version issue !!

Yii with Bootstrap error (CWebApplication.bootstrap not defined)

I have followed this setup, but not work for me http://www.cniska.net/yii-bootstrap/setup.html, all CSS files do not give style to the page,
So searching I found this thread How to install bootstrap extension in yii using some tricks. But not work's too.
Now I have this error
'Property "CWebApplication.bootstrap" is not defined.'
Anyone can help or have any idea?
Thanks in advance and for my English.
Property "CWebApplication.bootstrap" is not defined.
The error means the system is trying to access Yii::app()->bootstrap, which could be a property on the application. Since bootstrap is a component it should be accessible, if the configuration is done properly.
This error is most likely because you forgot the following in the main config file:
'components'=>array(
'bootstrap'=>array(
'class'=>'bootstrap.components.Bootstrap',
),
),
// This should point to the location you placed the files in for example extensions/bootstrap/components/bootstrap.php
The class location above will only work if the alias is set properly before setting the configuration.
Yii::setPathOfAlias('bootstrap', dirname(__FILE__).'/../extensions/bootstrap');
Instead you could also change "bootstrap.components.Bootstrap" into "application.extensions.bootstrap.components.bootstrap".
I strongly advise you to use Yiistrap, it was made by the person who create yii boostrap and the person who created Yiibooster. Yiistrap has everything from both extensions and more new stuff. here is the page http://www.getyiistrap.com , also has a fully documented API which yii boostrap do not have and it will save a lot of google searches.

Format month/year in Ektron calendar header

Version 8.0.1 SP1
Our client would like us to reformat the month/year in the calendar header. See attached image. They want "April, 2012" instead of the abbreviated "Apr, 2012". Where is this specified? I have looked at the webcalendar objects, css files, xslt files.
Any suggestions?
I haven't made that particular change, but have faced similar requests. Your options are-
Use Javascript (jQuery) to reformat on client side
Dig around in the workarea looking for formatting code, though usually the formatting code is locked up in a DLL.
DisplayXslt or EkMarkup - some controls allow you to apply XSLT or EkMarkup (Ektron markup template) for custom display. You create an XSLT, and apply it via the DisplayXslt property on the control.
Discard the control, and use the APIs to drive your own custom control.
Also, this Ektron forum post suggests having a look at this file- workarea/webcalendar/xsl/default.xsl
If this file exists (I don't have an Ektron installation currently handy), then it is likely you can use the DisplayXslt method described above.

PrimeFaces with multiple p:fileUpload tags on one page -- only the last tag works

I use PrimeFaces 3.0-SNAPSHOT with JBoss AS7. I put three <p:fileUpload> tags in one form with option auto=true.
The problem is that to upload files I have to start with the last form and then upload to prelast and finally to the first one. Otherwise nothing is sent to the server (there is nothing to watch in FireBug JS console nor in Net console). Do you know how to resolve it? Uploading multiple files using one component is not usable for me.
EDIT: Forms are like:
<p:fileUpload id="videoThumbnail"
fileUploadListener="#{videoWrapper.handleImageUpload}"
update="#{#form}" process="#{#all}" auto="true" showButtons="false"/>
And videoWrapper.handleImageUpload is a typical PrimeFaces uploading handler. I don't enclose it, because I think it's not a problem. Requests are not sent to the server, so java server side seems to be unrelated.
I got an answer on PrimeFaces forum: http://forum.primefaces.org/viewtopic.php?f=3&t=16917&p=52525. Now this situation is not supported, maybe it will change in the future.