0

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">
  var dirty = true
</script>

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

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

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.