Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6542391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:13:18+00:00 2026-05-25T11:13:18+00:00

I am trying to build sample JSF 2 based autocomplete form. I am using

  • 0

I am trying to build sample JSF 2 based autocomplete form. I am using primefaces 3.0.M2, JSF 2.1.2 libraries and JBoss 6.

I am using autoComplete component of primefaces but its not working. I am not getting any autocomplete text when I type in input text box.

I can see only following warning in JBoss console window :

19:40:56,874 WARN  [Parameters] Parameters: Invalid chunk ignored.

My xhtml file looks like following :

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.prime.com.tr/ui">
    <h:head>
       <title>sample auto completer</title> 
    </h:head>
    <h:body>
        <p:messages id="messages" />
        <p:autoComplete id="AutoCompleter" 
            value="#{myBean.text}" 
            completeMethod="#{myBean.complete}"
            onSelectUpdate="messages"/>
    </h:body>
</html>

and java bean code is as follows :

package com.shekhar.jsf;

import java.util.ArrayList;
import java.util.List;

public class Bean {

    private String text;

    public List<String> complete(String val) {
        List<String> lst = new ArrayList<String>();

        for (int i = 0; i < 10; i++) {
            lst.add(val + i);
        }
        return lst;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getText() {
        return text;
    }
}

and my faces-config file contains following code :

<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
    version="2.0">
    <managed-bean>
        <managed-bean-name>myBean</managed-bean-name>
        <managed-bean-class>com.shekhar.jsf.Bean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
</faces-config>

I dont understand which thing I am missing. Please help !!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:13:19+00:00Added an answer on May 25, 2026 at 11:13 am

    From the comment above as the accepted answer

    You should see output in the console or in the log files for System.out.println(). If you did not then that means the complete method is not getting executed. It might be because you need to wrap your autoComplete and messages components in an <h:form prependId="false">.

    Glad to see it worked for you. It may seem strange but there are a LOT of similarities between JSF and ASP.NET. I used to be an ASP.NET developer and I picked up JSF fairly easy. Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build an Java EE 6-application on GlassFish V3, using JSF 2.0,
I'm trying to build a sample game in Silverlight 4 using the MVVM design
I'm trying to build this iPhone sample: http://trac.pjsip.org/repos/wiki/Getting-Started/iPhone but I'm having trouble since I
I am trying to build a grid, using class info and its properties along
I am trying to build a sample for myself using MVC3, Razor view engine
I'm currently trying to build a simple component which should monitor, if the user
we are trying to build the Haskell-MaybeMonad sample from http://www.haskell.org/all_about_monads/html/maybemonad.html in F#. The idea
I'm trying to build a simple autocomplete list: DOM: <input id=example/> <div id=results></div> Javascript:
I'm trying to build a simple unit test executable, using cpputest. I've built the
I'm trying to build a C++ extension for python using swig. I've followed the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.