Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Licensed to the Apache Software Foundation (ASF) under one or more
   * contributor license agreements.  See the NOTICE file distributed with
   * this work for additional information regarding copyright ownership.
   * The ASF licenses this file to You under the Apache License, Version 2.0
   * (the "License"); you may not use this file except in compliance with
   * the License.  You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package org.apache.wicket.extensions.ajax.markup.html.autocomplete;
 
 
An implementation of a textfield with the autoassist ajax behavior

Author(s):
Igor Vaynberg (ivaynberg)
Since:
1.2
See also:
AutoCompleteBehavior
IAutoCompleteRenderer
 
 public abstract class AutoCompleteTextField extends TextField
 {
 
 	private static final long serialVersionUID = 1L;

Parameters:
id
type
 
 	public AutoCompleteTextField(String idClass type)
 	{
 		this(id, (IModel)nulltype);
 	}

Parameters:
id
model
type
 
 	public AutoCompleteTextField(String idIModel modelClass type)
 	{
 		this(idmodeltype.);
 
 	}

Parameters:
id
object
 
 	public AutoCompleteTextField(String idIModel object)
 	{
 		this(idobject, (Class)null);
 	}

Parameters:
id
 
 	{
 		this(id, (IModel)null);
 
 	}

Parameters:
id
renderer
 
 	{
 		this(id, (IModel)nullrenderer);
 	}

Parameters:
id
type
renderer
 
 	public AutoCompleteTextField(String idClass typeIAutoCompleteRenderer renderer)
 	{
 		this(idnulltyperenderer);
 	}

Parameters:
id
model
renderer
	public AutoCompleteTextField(String idIModel modelIAutoCompleteRenderer renderer)
	{
		this(idmodel, (Class)nullrenderer);
	}

Parameters:
id
model
type
renderer
	public AutoCompleteTextField(String idIModel modelClass typeIAutoCompleteRenderer renderer)
	{
		super(idmodeltype);
		// this disables Firefox autocomplete
		add(new SimpleAttributeModifier("autocomplete","off"));
		{
			private static final long serialVersionUID = 1L;
			protected Iterator getChoices(String input)
			{
				return AutoCompleteTextField.this.getChoices(input);
			}
		});
	}

Callback method that should return an iterator over all possible assist choice objects. These objects will be passed to the renderer to generate output. Usually it is enough to return an iterator over strings.

Parameters:
input current input
Returns:
iterator ver all possible choice objects
See also:
AutoCompleteBehavior.getChoices(java.lang.String)
	protected abstract Iterator getChoices(String input);
New to GrepCode? Check out our FAQ X