简体   繁体   中英

A beginner's JSF question about form validation

I am having a form and many input elements in that. I want certain fields to be validated, so i keep validateLenth etc on those. And i want some fields to not be validated. For example, i have contact information and address information both on the same page. I want to treat contact information as one group. So if some fields are invalid they should not be submitted and address information to be independent of contact information. Thus, if address information is corrected it should be submitted. I have one form only on the page but two buttons, one for address and one for contact.

Simply put :- What is the equivalent of validationGroup of Asp.Net in JSF?

Use two different forms.

This sounds logical since you have two separate sets of data that are submitted via two different buttons.

If you can't, take a look at <t:subform>

Or switch to <rich:tabPanel>

In our application we use <a4j:region> which is an AjaxRegion component from RichFaces component library . I have no experience with Asp.Net, but it seems the thing you are looking for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM