Is there a JSF component that supports autocomplete and can hold multiple values? - jsf

I'm developing an application in JSF 2.0.
I was wondering if there is a JSF component that supports an autocomplete function and that can hold multiple values (that binds to an array or a list). I don't have the time and knowledge to create such a component myself.
I know PrimeFaces has got the p:autoComplete (http://www.primefaces.org/showcase-labs/ui/autoCompletePojo.jsf) component, but it can only 'hold' one value. I'd need a component that can do what p:auotoComplete does, but multiple times; the textarea should be able to display multiple values. Is there a library that contains such a component?
Any help would be greatly appreciated.

The latest PrimeFaces snapshot 3.1 got AutoComplete - Multiple Selection
You can get it from here
3.1-SNAPSHOT

You might see this Richfaces example. I think that tokens and autoFill = "false" will work.

Related

how to render primefaces dynaform with ui-repeat,p:datalist

I'm trying to create multiple dynaforms in my page which will repeat multiple times by clicking button.
To do this i've used ui-repeat but this is not displaying any dynaform at all.As an alternative solution i have used primefaces datalist(or datatable) they are able to repeat the dynaforms. But here in this solution i'm facing another problem with pe:timepicker, that is if i change value in one time picker that effect all the time pickers in repeated dynaforms.
Is there any solution for repeating dynaforms in ui-repeat. How to isolate the timepicker value change specific to dynaform.
I am using JSF2.1.24,primefaces 4.0-snapshot and primefaces-extention-1.0.0.RC1.
ui:repeat was always buggy. And yes, DynaForm works within PrimeFaces data iteration components. How do you change value in pe:timepicker? There are some tricks for DynaForm. See e.g. this one.
I would suggest you ask in our sub-forum for more information.
Please also use the last final releases 4.0.0 and 1.0.0 respectively.

Process only input fields whose values have been modified?

Is there any easier way to set to process only those input fields within a h:form whose values have actually been changed at the client side ignoring those that havent changed?
Using JSF 2.2 with
Primefaces 3.2
Not in JSF 2.2, nor in PrimeFaces 3.2.
Closest what you can get is PrimeFaces 3.3 (currently only available as snapshot) with new client ID selector syntax which is borrowed from the jQuery selector API. Unfortunately, this doesn't support some :changed selector (even already not in jQuery selector API).
This is not exactly trivial to implement and integrate in PrimeFaces JS API. You basically need to hook a change listener on every single input element in the background wherein you collect client IDs of those who have been changed.

Pagination for ArrayList in JSF2

I have one searched arraylist that i am getting from Database for that array list i want to apply paginataion with links First, Prev, Next, Last and Goto page dropdown here i don't want to call database for every request(i.e First,Prev,etc) i want to use arrylist that returned at the time of search.And one more requirement is field level sorting need to do Ascending,descending if user clicks on header field.can any one help me to fix this i want to use only JSF2 no RichFaces,etc
Thank in advance.
Why do you not want to use rich or prime faces or others? Just use primefaces datatable with paginator="true".
If you don't want it, but want to do it the hard way. I suggest you fetch everything from database. Use a datatable and in the getter of that table, you only give back a portion of your array. (index 10 to 20, or index 20 to 40 or...)
On top or bottom of your datatable you put some outputlinks. These can set the indexes you want to retrieve.
Hope my explanation is clear.
In case Myfaces Tomahawk is an option for you...
I see it (Myfaces Tomahawk) as a bit different from PrimeFaces/Richfaces cause MyFaces are responsible for the MyFaces JSF Implementation as well (so it could be an excuse for using Myfaces Tomahawk), so you can use the Myfaces JSF implementation + Myfaces Tomahawk
Take a look at the Myfaces Tomahawk datascroller

jsf popupwindow with a datatable

I have a form which one of it's fields is a code and description, also a button for opening a popup window that contains a list of all of the available codes.
when the user double clickes a row from that table i want to set these values to the code and description. - how can this be done?
Another question, I want to create this popup and table to be initialized dynamically - by that i mean that if i have a few forms in my application, when ever i have a field which has a description i want to be able to open this popup and to see the available list for that field. (every field can be from a diffrent table). is it possible to create something like that? if so, how?
Any help will be appritiated,
Thank's In Advance.
Yes, it is possible. Even more, many component libraries have ready to use popup/dialog components, such as RichFaces with <rich:popupPanel> and PrimeFaces with <p:dialog>.
If you do not want to use a component library for some reason, you would need to create a custom component for this which generates basically an absolutely positioned HTML <div> element with a CSS overlay which get shown/hidden by JS on a particular click/action. The HTML/CSS/JS part should be relatively simple if you are familiar with those languages. The JSF part is somewhat hard if you have never created a custom component before, but it should be possible with a composite component as well, so you could also just create one with pure XHTML. The updating/refreshing can just take place by the usual <f:ajax> means.

Remove auto generated j_id from composite components

I'm loving the jsf 2.0 composite component setup. One other thing I love is prependId="false" on forms. Is there an equivalent that can be defined in cc:interface or cc:implementation that will prevent jsf from creating a j_id to prepend to the ids defined within the composite component?
That's not possible. Just give the component a fixed id instead letting JSF autogenerate one. The same applies on forms by the way. This way you can still select them using CSS selectors.
Or better, just give them a styleClass so that you don't need to select by ID, for the case that this aversion was actually caused by inability to select components/elements by client ID (I don't see other feasible reasons).

Resources