wood burning stoves
The moose likes JSF and the fly likes Validation inside tr:table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Validation inside tr:table" Watch "Validation inside tr:table" New topic

Validation inside tr:table

prasad kolla

Joined: Jul 19, 2008
Posts: 12
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??
I agree. Here's the link: http://aspose.com/file-tools
subject: Validation inside tr:table
It's not a secret anymore!