{
RendererUtils.checkParamValidity(context, uiComponent, InputSuggestAjax.class);
InputSuggestAjax inputSuggestAjax = (InputSuggestAjax) uiComponent;
MethodBinding mb = inputSuggestAjax.getSuggestedItemsMethod();
Collection suggesteds = null;
int maxSuggestedCount = inputSuggestAjax.getMaxSuggestedItems()!=null
? inputSuggestAjax.getMaxSuggestedItems().intValue()
: DEFAULT_MAX_SUGGESTED_ITEMS;
if (inputSuggestAjax.getMaxSuggestedItems()!=null) {
try{
suggesteds = (Collection) mb.invoke(context,new Object[]{
AjaxPhaseListener.getValueForComponent(context, uiComponent),
new Integer(maxSuggestedCount)});
}catch(MethodNotFoundException dummy){
suggesteds = (List) mb.invoke(context,new Object[]{
AjaxPhaseListener.getValueForComponent(context, uiComponent)});
}
} else {
try{
suggesteds = (List) mb.invoke(context,new Object[]{
AjaxPhaseListener.getValueForComponent(context, uiComponent)});
}catch(MethodNotFoundException dummy){
suggesteds = (Collection) mb.invoke(context,new Object[]{
AjaxPhaseListener.getValueForComponent(context, uiComponent),
new Integer( DEFAULT_MAX_SUGGESTED_ITEMS )});
}
}