Autocomplete selectListener behavior

UI Components for JSF
Post Reply
User avatar
benpad
Posts: 58
Joined: 24 Jun 2010, 04:54
Location: Makati, City Philippines
Contact:

02 Jul 2010, 08:38

Hello experts,

I'm currently implementing a simple autocomplete component using PrimeFaces.

Code: Select all

<p:autoComplete completeMethod="#{videoBean.searchComplete}"
                                                    itemLabel="#{video.title}"
                                                    itemValue="#{video}"
                                                    selectListener="#{videoBean.handleSelect}"/>

Code: Select all

public void handleSelect(SelectEvent event) {
        String selectedItem = (String) event.getObject();
        System.out.println(selectedItem); // The String I typed
}
This code is working, the video titles displayed when I typed the title. My problem is in the selectListener, when I type and select the video title I want, the handleSelect method prints out the string I typed not the whole title I selected.

Thanks
PrimeFaces 2.1
JSF 2.0
GlassFish 3 Server
Mojarra 2.0.2

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests