I'm trying to implement a simple command button component that will send a value in the backing bean.
Code: Select all
<p:commandButton value="Save" actionListener="#{myBean.someMethod}" async="true" ajax="true" update="@form">
<f:attribute name="parameter" value="composeTheParameters()"/>
</p:commandButton>
Code: Select all
function composeTheParameters() {
return 'simple parameter';
};
Code: Select all
public void someMethod(ActionEvent event) {
String param = (String) event.getComponent().getAttributes().get("parameter");
logger.debug(param);
}