aspose file tools*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Validation inside tr:table" Watch "Validation inside tr:table" New topic
Author

Validation inside tr:table

prasad kolla
Greenhorn

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%"
value="#{mybean.listOfConfirmationChecks}">
<tr:column width="95%" separateRows="true">
<tr:selectBooleanCheckbox id="confirmationCheckBox"
disabled="#{result.isDisabled}" validator="#mybean.validateCheckbox}"
autoSubmit="true" value="#{result.isChecked}" required="#{result.isMandatory}" />
</tr:column>
</tr:table>



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??
 
 
subject: Validation inside tr:table
 
Similar Threads
Problem with Trinidad Nested Table (depth 3)
disabling a particular column in a dynamic table
table and partial triggers
tr:commandButton actionListener not invoking managed bean method
Partial page refresh during page onload