Class AutoComplete
- java.lang.Object
-
- org.primefaces.selenium.AbstractPrimePageFragment
-
- org.primefaces.selenium.component.base.AbstractComponent
-
- org.primefaces.selenium.component.base.AbstractInputComponent
-
- org.primefaces.selenium.component.AutoComplete
-
- All Implemented Interfaces:
org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.WebElement,org.openqa.selenium.WrapsElement
public abstract class AutoComplete extends AbstractInputComponent
Component wrapper for the PrimeFacesp:autoComplete.
-
-
Constructor Summary
Constructors Constructor Description AutoComplete()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()Activates search behaviorvoidaddItem(String item)Adds an item to the input field.voidclear()Clears the Autocomplete input and guards AJAX for "clear" event.voiddeactivate()Deactivates search behaviorintgetDelay()Delay to wait in milliseconds before sending each query to the server.org.openqa.selenium.WebElementgetInput()The input element reference.org.openqa.selenium.WebElementgetItems()List<String>getItemValues()org.openqa.selenium.WebElementgetPanel()List<org.openqa.selenium.WebElement>getTokens()Gets the actual token elements in mutliple mode.StringgetValue()List<String>getValues()If using multiple mode gets the values of the tokens.voidhide()Hides the AutoComplete-Panel.booleanisClearAjaxified()Is the input using AJAX "clear" event?booleanisItemSelectAjaxified()Is the input using AJAX "itemSelect" event?booleanisItemUnselectAjaxified()Is the input using AJAX "itemUnselect" event?booleanisQueryAjaxified()Is the input using AJAX "query" event?voidremoveItem(String item)Removes an item from the input field.voidsearch(String value)Execute the AutoComplete search.voidsendTabKey()Sends the Tab-Key to jump to the next input.voidsetValue(String value)Sets the value and presses tab afterwards.intsetValueWithoutTab(Serializable value)Sets the value without pressing tab afterwards.voidshow()Shows the AutoComplete-Panel.voidwait4Panel()Waits until the AutoComplete-Panel containing the suggestions shows up.-
Methods inherited from class org.primefaces.selenium.component.base.AbstractInputComponent
copyToClipboard, disable, enable, getAssignedLabel, getAssignedLabelText, isEnabled, isOnchangeAjaxified, pasteFromClipboard, selectAllText
-
Methods inherited from class org.primefaces.selenium.component.base.AbstractComponent
getWidgetByIdScript, getWidgetConfiguration, getWidgetConfigurationAsString, isAjaxified, isAjaxified
-
Methods inherited from class org.primefaces.selenium.AbstractPrimePageFragment
getElementLocator, getId, getRoot, getWebDriver, getWrappedElement, setElementLocator, setWebDriver
-
-
-
-
Method Detail
-
getInput
public org.openqa.selenium.WebElement getInput()
Description copied from class:AbstractInputComponentThe input element reference.- Overrides:
getInputin classAbstractInputComponent- Returns:
- the
WebElementrepresenting the input.
-
getItems
public org.openqa.selenium.WebElement getItems()
-
getPanel
public org.openqa.selenium.WebElement getPanel()
-
getValue
public String getValue()
-
isClearAjaxified
public boolean isClearAjaxified()
Is the input using AJAX "clear" event?- Returns:
- true if using AJAX for clear
-
isItemSelectAjaxified
public boolean isItemSelectAjaxified()
Is the input using AJAX "itemSelect" event?- Returns:
- true if using AJAX for itemSelect
-
isItemUnselectAjaxified
public boolean isItemUnselectAjaxified()
Is the input using AJAX "itemUnselect" event?- Returns:
- true if using AJAX for itemUnselect
-
isQueryAjaxified
public boolean isQueryAjaxified()
Is the input using AJAX "query" event?- Returns:
- true if using AJAX for query
-
getValues
public List<String> getValues()
If using multiple mode gets the values of the tokens.- Returns:
- the values in a list
-
getTokens
public List<org.openqa.selenium.WebElement> getTokens()
Gets the actual token elements in mutliple mode.- Returns:
- the List of tokens
-
setValue
public void setValue(String value)
Sets the value and presses tab afterwards. Attention: Pressing tab selects the first suggested value.- Parameters:
value- the value to set
-
setValueWithoutTab
public int setValueWithoutTab(Serializable value)
Sets the value without pressing tab afterwards.- Parameters:
value- the value to set- Returns:
- the delay in milliseconds
-
sendTabKey
public void sendTabKey()
Sends the Tab-Key to jump to the next input. Attention: Pressing tab selects the first suggested value.
-
clear
public void clear()
Clears the Autocomplete input and guards AJAX for "clear" event.- Specified by:
clearin interfaceorg.openqa.selenium.WebElement- Overrides:
clearin classAbstractInputComponent
-
wait4Panel
public void wait4Panel()
Waits until the AutoComplete-Panel containing the suggestions shows up. (eg after typing)
-
show
public void show()
Shows the AutoComplete-Panel.
-
hide
public void hide()
Hides the AutoComplete-Panel.
-
activate
public void activate()
Activates search behavior
-
deactivate
public void deactivate()
Deactivates search behavior
-
addItem
public void addItem(String item)
Adds an item to the input field. Especially useful in 'multiple' mode.- Parameters:
item- the item to add to the tokens
-
removeItem
public void removeItem(String item)
Removes an item from the input field. Especially useful in 'multiple' mode.- Parameters:
item- the item to remove from the tokens
-
search
public void search(String value)
Execute the AutoComplete search.- Parameters:
value- the search to execute
-
getDelay
public int getDelay()
Delay to wait in milliseconds before sending each query to the server.- Returns:
- Delay in milliseconds.
-
-