Récupération d'une ligne de HtmlDataTable
Bonsoir,
J'ai un problème pour récupérer une ligne de mon "HtmlDataTable".
voila le code relatif à HtmlDataTable dans ma page JSF:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| <rich:scrollableDataTable id="clientTable"
binding="#{clientBean.table}" value="#{clientBean.cls}" var="clt"
width="300px" height="200px">
<a4j:support event="onRowDblClick" action="#{clientBean.viewDetail}"/>
<rich:column id="clientId" width="60px">
<f:facet name="header">
<h:outputText value="Id" />
</f:facet>
<h:outputText value="#{clt.clientId}" />
</rich:column>
<rich:column id="nom" width="240px">
<f:facet name="header">
<h:outputText value="Nom" />
</f:facet>
<h:outputText value="#{clt.nom}" />
</rich:column>
</rich:scrollableDataTable> |
La methode viewDetail doit me permettre la récupération de la ligne sur laquelle l'utilisateur a fait un double click
sauf que lorsque je fais le double click j'ai une erreur qui porte sur les types de Iterator<SimpleRowKey> et intValue() ci-dessous :cry:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
private HtmlDataTable table;
public String viewDetail() {
List<Client> valeurClient = (List<Client>) table.getValue();
Iterator<SimpleRowKey> keys = table.getSelection().getKeys();
if(keys.hasNext())
{
currentClient = valeurClient.get(keys.next().intValue());
return "detail";
}
return null;
} |
Est ce que quelqu'un peut m'aider ou bien me donner une autre méthode pour récupérer une ligne de HtmlDataTable:(
Merci