Can you see if it's a duplicate of this: http://issues.apache.org/jira/browse/WICKET-1504
If so, I'm not sure why you would be experiencing it - as that issue says that it was fixed in 1.3.6 and you said you're using 1.3.6. Did you just recently switch to 1.3.6? If so, have you cleared your cache? -- Jeremy Thomerson http://www.wickettraining.com On Thu, May 28, 2009 at 3:51 AM, Christian G. Fichera<[email protected]> wrote: > Dear all, > > I have a problem using AutoCompleteTextField: when I type something into it, > the choices list is not shown, and the following javascript error is thrown: > > > Webpage error details > > User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; > .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR > 3.0.04506.648) > Timestamp: Thu, 28 May 2009 08:19:40 UTC > > > Message: Invalid argument. > Line: 253 > Char: 1 > Code: 0 > URI: > http://localhost:8080/TADinfo/analysis/resources/org.apache.wicket.extension > s.ajax.markup.html.autocomplete.AutoCompleteBehavior/wicket-autocomplete.js > > > > > This problem occurs only with IE8 (with IE7, IE6 and Firefox works), and > Wicket 1.3.6 (with version 1.3.4 works). > > Can anybody help me? > > Thank you in advance! > > Here is the code: > > private class LocalitiesAutoCompleteTextField extends > AutoCompleteTextField{ > > > private int type; > > private final static int MIN_CHAR = 0; > private final static int MAX_RES = 10; > private Object selectedObject; > > > > public LocalitiesAutoCompleteTextField(String id, int type, final > IModel model){ > super(id, model);//, new LocalityListRenderer()); > this.type = type; > > } > > > public Object getSelectedObject(){ > return selectedObject; > } > > > �...@override > public String getModelValue(){ > return super.getModelValue(); > } > > > �...@override > public Iterator getChoices(String input) { > if (!Strings.isEmpty(input)){ > List choices = new ArrayList(); > if (input.length() >= MIN_CHAR){ > int i=0; > switch(type){ > case LAYER0: > for (Layer0 > layer0:facade.selectLayer0ByDisplayNameStartingWith(input)){ > if (++i > MAX_RES){ > break; > } > choices.add(layer0); > } > for (Layer0 > layer0:facade.selectLayer0ByDisplayNameContaining(input)){ > if (++i > MAX_RES){ > break; > } > choices.add(layer0); > } > if (i>MAX_RES){ > choices.add(MORE); > } > break; > case LAYER1: > for (Layer1 > layer1:facade.selectLayer1ByDisplayNameStartingWith(input)){ > if (++i > MAX_RES){ > break; > } > choices.add(layer1); > } > for (Layer1 > layer1:facade.selectLayer1ByDisplayNameContaining(input)){ > if (++i > MAX_RES){ > break; > } > choices.add(layer1); > } > if (i>MAX_RES){ > choices.add(MORE); > } > break; > case LAYER2: > for (Layer2 > layer2:facade.selectLayer2ByDisplayNameStartingWith(input)){ > if (++i > MAX_RES){ > break; > } > choices.add(layer2); > } > for (Layer2 > layer2:facade.selectLayer2ByDisplayNameContaining(input)){ > if (++i > MAX_RES){ > break; > } > choices.add(layer2); > } > if (i>MAX_RES){ > choices.add(MORE); > } > break; > case LOCALITY: > for (Localitydb > locality:facade.selectLocalityByDisplayNameStartingWith(input)){ > if (++i > MAX_RES){ > break; > } > choices.add(locality); > } > > for (Localitydb > locality:facade.selectLocalityByDisplayNameContaining(input)){ > if (++i > MAX_RES){ > break; > } > choices.add(locality); > } > if (i>MAX_RES){ > choices.add(MORE); > } > break; > } > return choices.iterator(); > } > } > return Collections.emptyList().iterator(); > } > } > > class LocalityListRenderer extends AbstractAutoCompleteTextRenderer{ > �...@override > public void renderChoice(Object object, Response response, String > criteria) { > String string = ""; > if (object instanceof Localitydb){ > string = > LocalityListComponentPanel.this.getPath(((Localitydb)object)); > } > else if (object instanceof Layer2){ > string = > LocalityListComponentPanel.this.getPath(((Layer2)object)); > } > else if (object instanceof Layer1){ > string = > LocalityListComponentPanel.this.getPath(((Layer1)object)); > } > else if (object instanceof Layer0){ > string = ((Layer0)object).getDisplayname(); > } > else if (object instanceof String && > object.toString().equals(MORE)){ > response.write("<span > style=\"font-style:italic;text-align:center\">" + MORE + "</span>"); > return; > } > else{ > return; > } > if (string.contains(SEPARATOR)){ > int index = string.indexOf(SEPARATOR); > String path = string.substring(index); > String info = string.substring(0, index); > StringBuffer sb = new StringBuffer(); > sb.append("<table width=\"95%\">"); > sb.append("<tr>"); > sb.append("<td align=\"left\">"); > sb.append("<span style=\"font-size:x-small\">"); > sb.append(info); > sb.append("</span>"); > sb.append("</td>"); > sb.append("<td align=\"right\">"); > sb.append("<span > style=\"color:grey;font-style:italic;font-size:xx-small\">"); > sb.append(path); > sb.append("</span>"); > sb.append("</td>"); > sb.append("</tr>"); > sb.append("</table>"); > response.write(sb); > } > else{ > response.write(string); > } > } > �...@override > protected String getTextValue(Object object) { > if (object instanceof Localitydb){ > return ((Localitydb)object).getDisplayname(); > } > if (object instanceof Layer2){ > return ((Layer2)object).getDisplayname(); > } > if (object instanceof Layer1){ > return ((Layer1)object).getDisplayname(); > } > if (object instanceof Layer0){ > return ((Layer0)object).getDisplayname(); > } > return ""; > } > > } > >
