wood burning stoves 2.0*
The moose likes JSF and the fly likes JSF validation issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF validation issue " Watch "JSF validation issue " New topic

JSF validation issue

hemant joshi

Joined: Sep 21, 2011
Posts: 1
1)We are using JSF 2.0 datatable , at each row of datatable we are performing crud operations.For that we are doing validating for each row .There is a EDIT button for each row ,so when clicked on three row's EDIT button and we get two buttons SAVE and CANCEL .Now when we are saving empty single out of three empty rows ,validation message is coming for all the three rows.

2)for <f:ajax> tag execute=@id is not working for me ...

Please find the below code :

<h:dataTable value="#{manage.manageList}"
var="manage1" styleClass="TableBorder" cellspacing="0"
cellpadding="0" headerClass="category-table-header"
rowClasses="Whiterow,Greyrow" style="width: 610px; margin-top:0px; height:auto" columnClasses="Column130L,Column90,Column70,Column110,Column90">
<h:messages id="messages" />
<h:column styleClass="TableTxt">
<h:inputText value="#{manage1.manageName}" size="10" style="margin-left:40px;"
id="manageName" rendered="#{!manage1.readOnly}"
requiredMessage="#{msg.msg_Name_required}" styleClass="TableInput">

<hutputText value="#{manage1.manageName}"
rendered="#{manage1.readOnly}" />
<h:column style="align:center;">
<h:inputText value="#{manage1.months}" id="months" size="10"
rendered="#{!manage1.readOnly and manage1.planCount==0}"
required="true" requiredMessage="#{msg.msg_months_required}"
validatorMessage="#{msg.msg_months_validate}" styleClass="TableInput">
<f:validateLongRange minimum="1" maximum="999"/>
<hutputText value="#{manage1.months}"
rendered="#{!manage1.readOnly and manage1.planCount>0}" />
<hutputText value="#{manage1.months}"
rendered="#{manage1.readOnly and manage1.months!=0}" />
<h:column style="align:center;">
<h:inputText value="#{manage1.years}" id="years" size="10"
required="true" requiredMessage="#{msg.msg_years_required}"
validatorMessage="#{msg.msg_years_validate}" styleClass="TableInput">
<f:validateLongRange minimum="1" maximum="999999" />
<hutputText value="#{manage1.years}"
rendered="#{!manage1.readOnly}" />
<hutputText value="#{manage1.years}"
rendered="#{manage1.readOnly and manage1.years!=0}" />

<h:column style="align:center;">
<h:commandButton value="#{msg.label_save}" class="BlueBtn"
<f:ajax execute="@form" render="@form" />
<h:commandButton value="#{msg.label_cancel}" class="BlueBtn"
rendered="#{manage1.showCancelButton}" immediate="true">
<f:ajax execute="@this" render="@form" />
<h:commandLink actionListener="#{manage.editmanage}" rendered="#{manage1.showEditButton}">
<hutputText style="font-weight: bold;"
value="#{msg.label_edit}" />
<f:ajax execute="@form" render="@form" />
<h:commandButton value="#{msg.label_add}" type="submit" class="BlueBtn"
<f:ajax execute="@form" render="@form" />

So anybody can suggest me some better way to do it or any solution fro this issue.

wood burning stoves
subject: JSF validation issue
Similar Threads
need help in jquery
FacesException: f:ajax contains an unknown id - cannot locate it in the context of the component
Action Event
JSF 2.0 GlassFish 3.0.1 problem
simulate clicking of edit column command button in data table from another component in data table