i try to fix unmanagable code like this:
<a4j:commandButton action="dia_ok" actionListener="#{...}" ajaxSingle="true" .../>
i fix it by bind the button to an ManagedBean and swap all the attributes to Java-Code, so ill only have:
<a4j:commandButton binding="#{...}"/>
I successfully coded setAjaxSingle(true) and the actionListener-attribute, but i fail on code the action-Attribute.
My question is: how can i specify the action-outcome whereat the method button.setActionExpression() does only allows argument of MethodExpression instead of String?
You can just create a
MethodExpressionwith a value of"dia_ok"and a return type ofString. The expression does not necessarily refer to"#{bean.action}"or something.E.g.
with
I only fail to see how it makes the code more manageable as you’re mingling the view into the model this way. Perhaps you need to writeup some general convention how attributes should be ordered/organized so that it’s better manageable? E.g.
idfirst, thenvalue, etc and then be consistent with this convention.