Hi I would like to report a bug which also found in the showcases you have on website too (the one with POJOs). When I type some characters, the autocomplete would show me a list to choose from, right? There is a difference between choosing an item with a mouse click and choosing with up and down buttons. I use id as value and name as label for items in the list. If I use the mouse to choose, the submitted value comes back as id. But if I use up/down button to choose, the value that comes back is the label.
In addition to this bug, I would like to suggest that the autocomplete component should submit the form immediately when user choose an item. Right now I have to hit enter one more time to submit the form.
Thanks
Anan
Autocomplete Bug
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
Hi,
First one is a known issue;
http://code.google.com/p/primefaces/iss ... il?id=1017
First one is a known issue;
http://code.google.com/p/primefaces/iss ... il?id=1017
This behavior should be configurable as not everyone wants to submit the form when you select an item, that's why we have added the selectListener option.In addition to this bug, I would like to suggest that the autocomplete component should submit the form immediately when user choose an item. Right now I have to hit enter one more time to submit the form.
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
Thomas Andraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
I am not quite sure if "Forward" is the right wird. When the user selects an entry from the list, I would like to show another page showing more details of the selectd component.
I that is not possible, I will try adding links into the combobox.
Perhaps anybody has an idea how to solve that "little" problem.
Thanks
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
A redirect is possible, not a forward. it's a different "redirect" mechanism.
Just read the link...
Just read the link...
Thomas Andraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
Hello,
sorry that I have to come back on that issue. I understand the linked article, but they alway use h:commandbutton. In the autocomplete I use there is no button.
Below is the snippet I use. Where can I add the call for redirect?
Thanks
sorry that I have to come back on that issue. I understand the linked article, but they alway use h:commandbutton. In the autocomplete I use there is no button.
Below is the snippet I use. Where can I add the call for redirect?
Code: Select all
<p:autoComplete value="#{companysearch.companyData}" id="cs" completeMethod="#{companysearch.complete}"
var="p" itemValue="#{p}" itemLabel="#{p.name}"
converter="#{companyConverter}" forceSelection="true">
<p:ajax event="itemSelect" listener="#{autoCompleteBean.handleSelect}" update="messages" />
<p:column>
#{p.name} - #{p.isin}
</p:column>
</p:autoComplete>
Thanks
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
In your handleSelect method, redirect programmatically.
Thank you very much, that was the hint I needed. I thoug, that I have to add somethnig in xhtml, but that is not the case. Great.optimus.prime wrote:In your handleSelect method, redirect programmatically.
Here is the code I use:
Code: Select all
FacesContext ctx = FacesContext.getCurrentInstance();
ExternalContext extContext = ctx.getExternalContext();
String url = extContext.encodeActionURL(ctx.getApplication().getViewHandler().getActionURL(ctx, "/ajax/mytarget.xhtml"));
try {
extContext.redirect(url);
}
catch (IOException ioe) {
throw new FacesException(ioe);
}
-
- Information
-
Who is online
Users browsing this forum: No registered users and 52 guests