Now I really need help, because just could not get anything to work in couple of days and now I finally found out why but dont know how to work around :
if I have a commandbutton, outputPanel or another element and set either it's disabled or rendered attribute to a boolean function of my SessionScoped managed bean with parameters,
it uses the function, displays well, but there are no more actions or actionListener calls inside that element.
when the value of rendered or disabled attribute is just rendered="true" or disabled="#{disabled()}" everything works fine, but i have lots of buttons in my network editor datatable and I must hide many of them depending on the network status between the objects.
Backing Bean:
Code: Select all
@ManagedBean
@SessionScoped
public class NetworkEditorBean implements Serializable {
public boolean connected(INetworkSource source, INetworkDestination dest) {
if (source == null) {
return false;
}
return source.connectedTo(dest);
}
}
Code: Select all
<p:dataTable var="connections" value="#{networkEditorBean.connections}" id="networkTable">
<p:columns value="#{networkEditorBean.networkDestinations}"
var="networkDest" columnIndexVar="colIndex" id="columns">
<p:commandButton value="test"
actionListener="#{networkEditorBean.connectionChanged}"
id="testid"
update="networkTable"
rendered="#{(colIndex gt 1) and !networkEditorBean.connectionPossible(connections[colIndex], networkDest)}"
>
<f:param value="#{connections[colIndex].getId().toString()}" name="sourceId"/>
</p:commandButton>
</p:columns>
</p:dataTable>
if I use <f:setActionPropertyListener value="networkEditorBean.connectionPossible(connections[colIndex], networkDest)" target="booleanProperty"/> instead of <f:param>,
the function is called but both arguments are null. But above, the arguments are not null, the button is rendered/disabled depending on function and parameters, but no actions:(
I'm running this on primefaces 2.2RC2, glassfish 3.0.1 and mojarra 2.0.2
So did someone see this, that should be a common issue, but I also didn't find any information on this.
Many thanks for help!!