JSF-generated HTML element ID is changing, how to set it to a fixed element ID?

前端 未结 1 402
清歌不尽
清歌不尽 2021-01-05 08:46

I have a JSF input text component which has an id of search. In the generated HTML output it looks like this j_idt17:search, but the number 1

1条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-05 09:18

    Give the JSF component which generated the HTML element with id="j_idt17" a fixed ID. In this particular case, it's likely the HTML input element's parent

    element which is generated by the JSF component.

    So, this should do:

    
    

    This way the ID of the generated HTML element will become form:search.

    0 讨论(0)
提交回复
热议问题