Hi
I am trying to perform some client side action when an object is selected from the autoComplete drop down selection. I am struggling to find the right client side event for this. onselect, onchange, oncomplete events do not know whether an object was selected or not especially when there are no results returned. Richfaces has an event called 'onobjectchange' on their suggestionBox component which did the job. Is there something similar that I can use in p:autoComplete?
Also, is there a way to show a default label such as 'No results found' when there are, well, no results returned? I feel that it will confuse users when they dont see any results esp. when used in conjuction with forceSelection=true.
Please help. I need find a solution for this as soon as possible.
Object selecteded event in autoComplete?
Hi, i think you need the selectListener and onSelectUpdated options
Here is an example:
Good luck!!
Here is an example:
Code: Select all
<p:autoComplete id="productMessage" value="#{goBean.selectItem}"
completeMethod="#{autoCompleteBean.valueChanged}"
var="selectItem"
itemLabel="#{selectItem.label}"
itemValue="#{selectItem}"
minQueryLength="4"
maxResults="5"
forceSelection="true"
converter="productConverter"
selectListener="#{goBean.actionButton}"
onSelectUpdate="body myProductDetail"
style="width:400px;"
/>
Eclipse Helios.
JSF 2.0 Mojarra 2.0.2 (FCS b10)
Primefaces-2.2.1
jboss-6.0.0.-M4
EJB3.0/JPA
Hibernate
Mysql 5.1
JSF 2.0 Mojarra 2.0.2 (FCS b10)
Primefaces-2.2.1
jboss-6.0.0.-M4
EJB3.0/JPA
Hibernate
Mysql 5.1
poppy,
thanks for replying. But I think the option you have mentioned is for ajax updates/rendering. I still wont know whether or not I selected an item from the list. I may have to try callback parameters and see if that will help me.
thanks for replying. But I think the option you have mentioned is for ajax updates/rendering. I still wont know whether or not I selected an item from the list. I may have to try callback parameters and see if that will help me.
Thanks
Jaizen
Glassfish 3.1.2 | Mojarra 2.1.6 | Primefaces 3.5
Jaizen
Glassfish 3.1.2 | Mojarra 2.1.6 | Primefaces 3.5
-
- Information
-
Who is online
Users browsing this forum: No registered users and 45 guests