有没有办法使Wicket DropDownChoice中的写入选项可用?

有没有办法使Wicket DropDownChoice中的写入选项可用?,wicket,Wicket,我有一个字符串列表中的值列表。 List listString=Arrays.asList(…) 但是,我也希望有人可以写一个值,而不是列表中的内容。 以下是我填充列表的方式: private final List<String> theList = new ArrayList<>(); ... List<String> listString = Arrays.asList(...); ... theList.addAll(listString); ... D

我有一个字符串列表中的值列表。
List listString=Arrays.asList(…)
但是,我也希望有人可以写一个值,而不是列表中的内容。 以下是我填充列表的方式:

private final List<String> theList = new ArrayList<>();
...
List<String> listString = Arrays.asList(...);
...
theList.addAll(listString);
...
DropDownChoice<String> selections = new DropDownChoice<>("label", theList);
...
private final List theList=new ArrayList();
...
List listString=Arrays.asList(…);
...
theList.addAll(listString);
...
DropDownChoice selections=新的DropDownChoice(“标签”,列表);
...

如果DropDownChoice不支持,是否有其他Wicket API可以实现这一点?

Wicket的DropDownChoice可以与HTML
元素一起使用。HTMLSelectElement没有用于添加自定义值的
字段

您需要使用更高级的选择控件,如或,或任何其他类似的JavaScript小部件

如果您决定使用Select2,请选中