How to select JSF components using jQuery?

后端 未结 4 1463
时光取名叫无心
时光取名叫无心 2020-11-21 22:26

I am trying to implement jQuery with PrimeFaces and JSF components, but it\'s not working properly. When I tried to do the same with HTML tags it;s working properly.

4条回答
  •  礼貌的吻别
    2020-11-21 23:07

    You also can use the jQuery "Attribute Contains Selector" (here is the url http://api.jquery.com/attribute-contains-selector/)

    For example If you have a

      
    

    and you want to do something on its object you can select it with

    jQuery('input[id*="quantity"]')
    

    and if you want to print its value you can do this

    alert(jQuery('input[id*="quantity"]').val());
    

    In order to know the real html tag of the element you can always look at the real html element (in this case spinner was translated into input) using firebug or ie developer tools or view source...

    Daniel.

提交回复
热议问题