且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在javascript中获取托管bean属性值

更新时间:2021-09-08 02:26:59

你可以这样:

<h:inputText id="propertyId" value="#{myBean.property}" style="display:none"/>

并像这样访问它(请注意,如果它在表单内部,您可能需要添加表单前缀)

and access it like this (note that if its inside a form you might need to add the form prefix)

alert($('#propertyId').val()); // or alert($('#myFormId\\:propertyId').val());