开发者

Put parameter from JavaScript into EL function call in JSF2

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜