This is working fine and I am storing the results in a selectOneListbox but I cannot seem to trigger my custom validator
My tab view looks like
Code: Select all
<p:inputText id="users" value="#{myBean.users}" />
<p:commandButton value="->" action="#{myBean.onAddUsers}" update="users,userList" process="users @this" />
<p:selectOneListbox id="userList">
<f:selectItems value="#{myBean.userList}" />
<f:validator validatorId="my.package.UserValidator" />
</p:selectOneListbox>
Code: Select all
private String user;
private List<String> users;
public void onAddusers() {
List<String usersToAdd = new ArrayList<>(Arrays.asList(users.split(";")));
for (String u : userToAdd) {
userList.add(u.trim());
}
users = null;
}
The problem is I have invalid usernames. In other places I am using the same validator to ensure I only process valid ones and it works fine.
How can I get this list of users validated? I did originally envisage this being validated when a user clicked next to move to the next step but I am not too fussed about how and where just as long as it works and is obvious. Any suggestions?