Skip to content

Instantly share code, notes, and snippets.

@CedricL46
Last active March 24, 2022 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CedricL46/64c466909dac5a5a50b05cb8957726ef to your computer and use it in GitHub Desktop.
Save CedricL46/64c466909dac5a5a50b05cb8957726ef to your computer and use it in GitHub Desktop.
<!-- use xmlns:f="http://java.sun.com/jsf/core" in the f:view at the top of your jsf file -->
<!-- e.g: <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich" -->
<!-- Here's how to set binding values one a button click - useful when you want to set values right before commiting a user form -->
<af:commandButton text="YOUR_BUTTON" id="bid1" action="#{YOUR_SCOPE.YOUR_BEAN.YOUR_ACTION_FUNC}">
<!-- You can either set a custom value YOUR_VALUE or the value of another binding #{bindings.YOUR_SOURCE_BINDING.inputValue} -->
<!-- or even the value of an attribute of YOUR_BEAN with getter and setter generated-->
<f:setPropertyActionListener value="YOUR_VALUE" target="#{bindings.YOUR_TARGET_BINDING1.inputValue}"/>
<f:setPropertyActionListener value="#{bindings.YOUR_SOURCE_BINDING.inputValue}" target="#{bindings.YOUR_TARGET_BINDING2.inputValue}"/>
<f:setPropertyActionListener value="#{YOUR_SCOPE.YOUR_BEAN.YOUR_ATTRIBUTE}" target="#{bindings.YOUR_TARGET_BINDING3.inputValue}"/>
</af:commandButton>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment