I need to extract all form name (id) from getViewRoot(). To see if a component is a form I compare component.getFamily() with a “javax.faces.Form”. But if I have a form in an import view component the getFamily returns javax.faces.NamingContainer instead of javax.faces.Form. How can I know if a component is a form (javax.faces.form) ?
Your approach seems fine.
Nested form controls are not legal in a view.