Primefaces, JavaScript, and JSF does not work well together or am I doing something wrong

前端 未结 5 1879
野性不改
野性不改 2021-01-01 09:17

Here is something so simple


5条回答
  •  生来不讨喜
    2021-01-01 09:57

    In JSF, the ID of elements are prefixed by the ID of the form that contains them (more generally, their ID are prefixed by the ID of all the parent components that implements the NamingContainer interface). For example:

    
        
    

    will generate the following HTML code:

    
    

    To access the you must use the myForm:tom ID and not the tom ID itself.

    With jQuery, you will have to use $("myForm\:tom").focus();

提交回复
热议问题