In a basic registration screen (with button register records the screen) there are two panels:
Data panel:

Address panel:

I can register by completing only the Data panel. It is not necessary to fill the Address panel. However, if at least one field of the Address panel is filled, then all other fields in the same panel should be required.

How can I achieve this?
You need to check in the
requiredattribute if the other inputs have submitted a non-empty value. Since this can result in quite some boilerplate, here’s a kickoff example with only 3 input components.An alternative is to bind the components to the view and use
UIInput#getValue()to check the value of the previous components andUIInput#getSubmittedValue()to check them for next components (components are namely processed in the order as they appear in the component tree). This way you don’t need to hardcode client ID’s. You only need to ensure that binding names doesn’t conflict with existing managed bean names.You’ll understand that this produces ugly boilerplate when you have more and more components. The JSF utility library OmniFaces has a
<o:validateAllOrNone>validator for the exact purpose. See also the live demo. Based on your quesiton tags, you’re using OmniFaces, so you should already be set with just this: