f:param : unable to retrieve the UIParameter value in the backing bean

Hi,

Here the jsf code :

<h:form target="bottomRight">

<h:dataTable value="#{buildingHandler.buildingsModel}" var="building"

rows="#{buildingHandler.noOfRows}"

first="#{buildingHandler.firstRowIndex}">

<h:column>

<f:facet name="header">

<h:outputText value="Object id" />

</f:facet>

<h:commandLink value="#{building.objectId}">

<f:param value="#{building.objectId}" name="buildingParam"

binding="#{buildingHandler.buildingParam}" />

</h:commandLink>

</h:column>

<h:column>

<f:facet name="header">

<h:outputText value="Name" />

</f:facet>

<h:outputText value="#{building.name}" />

</h:column>

</h:dataTable>

</h:form>

Here the backing bean code :

publicvoid setBuildingParam(UIParameter buildingParam){

this.buildingParam = buildingParam;

String buildingId = ((String) buildingParam.getValue());

setCurrentBuilding(getBuilding(buildingId));

}

The buildingId String is null and all the content of the argument buildingParam as well ... Why ?

[1697 byte] By [kokoricoa] at [2007-11-26 15:07:36]
# 1
...
kokoricoa at 2007-7-8 8:57:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
...
kokoricoa at 2007-7-8 8:57:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

<h:commandLink value="#{building.objectId}">

<f:param value="#{building.objectId}" name="buildingParam" binding="#{buildingHandler.buildingParam}" />

</h:commandLink>

Weird construction. What exactly do you want to achieve? Do you just want to get the selected row? If so, just use HtmlDataTable.getRowData(). Also see http://balusc.xs4all.nl/srv/dev-jep-dat.html how to use datatables.

BalusCa at 2007-7-8 8:57:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...