Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validation inside tr:table

prasad kolla
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to display a list of check boxes which are displayed inside a tr:table, I am doing a server validation to check if the checbox is checked or not. If not selected i am throwing a validation message asking the user to select the check box.

In this process alignment of the check boxes is lost, it puts a empty space ahead of check box.

code looks like this:

<tr:table var="result" styleClass="indent" width="100%"
<tr:column width="95%" separateRows="true">
<tr:selectBooleanCheckbox id="confirmationCheckBox"
disabled="#{result.isDisabled}" validator="#mybean.validateCheckbox}"
autoSubmit="true" value="#{result.isChecked}" required="#{result.isMandatory}" />

inside the bean i have a validator method:

public void validateCheckbox(FacesContext context, UIComponent component, Object value) {
if (value instanceof Boolean && ((Boolean) value).equals(Boolean.FALSE)) {
String clientId = component.getClientId(context);
FacesMessage message = MessageFactory.getMessage(context,UIInput.REQUIRED_MESSAGE_ID);
throw new ValidatorException(message);

does any one have any idea how to make an alignment or

How to call a validator method on page submition to validate the attributes of the list??
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic