Autocomplete Bug

UI Components for JSF
Post Reply
anan
Posts: 5
Joined: 17 May 2010, 06:37

30 Aug 2010, 09:35

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

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

30 Aug 2010, 11:14

Hi,

First one is a known issue;

http://code.google.com/p/primefaces/iss ... il?id=1017
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.
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.

MP3HiFi
Posts: 8
Joined: 23 Feb 2012, 21:55

04 Mar 2012, 22:37

Hello,

is there any example for an action when selecting a element from a list. I need to show another page, when the user has selected a value from the list.

Thanks in advance

MP3HiFi
Posts: 8
Joined: 23 Feb 2012, 21:55

05 Mar 2012, 22:57

Hello,

I managed it receiving the OnSelect message from Ajax in my bean, but I am not able to do a forward inside the listener method.
Is there any easy solution for that problem?

Thanks in advance

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

05 Mar 2012, 23:02

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

MP3HiFi
Posts: 8
Joined: 23 Feb 2012, 21:55

05 Mar 2012, 23:15

zoigl wrote:Forward isn't possible.

http://weblogs.java.net/blog/driscoll/a ... g_fro.html
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

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

05 Mar 2012, 23:24

A redirect is possible, not a forward. it's a different "redirect" mechanism.
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

MP3HiFi
Posts: 8
Joined: 23 Feb 2012, 21:55

06 Mar 2012, 14:58

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?

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

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

06 Mar 2012, 15:17

In your handleSelect method, redirect programmatically.

MP3HiFi
Posts: 8
Joined: 23 Feb 2012, 21:55

06 Mar 2012, 16:10

optimus.prime wrote: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.

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);
}

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 52 guests