开发者

Put parameter from JavaScript into EL function call in JSF2

开发者 https://www.devze.com 2023-02-07 21:48 出处:网络
In JSF2 we can use parameters in EL, which is great. However, I don\'t know how to use parameters from JavaScript there. This code doesn\'t work:

In JSF2 we can use parameters in EL, which is great. However, I don't know how to use parameters from JavaScript there. This code doesn't work:

<script type="text/javascript"&开发者_如何学编程gt;
  var dirty = true
</script>

<h:commandButton value="Back" action="#{bean.setDirty(dirty)}" />

Is it possible to add parameters from JavaScript? How to do it?


No. Bind a hidden field to the bean and use JavaScript to set the hidden field value. When the request is submitted, the hidden value will be available to your server-side action.

0

精彩评论

暂无评论...
验证码 换一张
取 消