Hello, I'm starting a small project, using JSF 2.0. I'm having problems right in the start, in the CRUD of the first model implemented.
What I want to do is pretty simple:
The page has some filters to search, and using ajax, it populates a h:dataTable with the results. The user should now select the line with the result he wants to see/edit. But I just can't find a way to make the line selectable.
This is my table:
<h:dataTable var="aluno" value="#{alunoController.resultado}" >
<h:column>
#{aluno.id}
</h:column>
<h:column>
#{aluno.nome}
</h:column>
<h:column>
<!-- radiobutton, commandLink/Action goes gere -->
</h:column>
</h:dataTable>
First I tried having a radiobutton on each line, then I learned that I cant have a radiogroup inside a table.
Then I tried having a radio group inside the first cell of each line, and handling selecion with a little bit of javascript. Somehow, the databinding doesn't work, and I cant get the selected model back in my ManagedBean.
So I tried having a commandButton/Link, which sends the model via parameter.... not. It just refresh the page.
The I tried using query parameters, sending the id of that row and getting the model from de database again, but I cant find a way to tell wich method should be called in the ManagedBean.
So I came here for my very first time, looking for suggestions. What should I do? Am I missing some information?
Tell me if you need more information.
I just don't want to believe what I want to do is too advanced.
Sorry for the bad english.