How does JSF generate the name of the form input field?

后端 未结 4 814

Any idea anyone? Is it possible that we specify the name of the form input field? How to go about doing that?

4条回答
  •  情话喂你
    2021-01-13 14:29

    More generally, all JSF components have an ID. If you don't provide one, JSF will create an automatic ID, using the format j_idXXX (XXX is a incremented number).

    Some components implement the javax.faces.component.NamingContainer interface, in particular . This means that all children of this component will have their ID prefixed by the ID of this container, separated by a ':'. So, in the example:

    
        
    
    

    the real ID of the input (i.e. the ID of the HTML input object) will be myForm:myInput.

提交回复
热议问题