anonymous wrote : First problem can be solved by passing the id as a request
parameter instead of blindly using @DataModelSelection.
Could anybody please explain how they've done this with their code?
The code below explains how to remove the appropriate entity when you have a
request parameter passed in. But how can I make every row in the dataTable
output a corresponding request parameter (so that when someone clicks a link in
the table, the request parameter gets passed)?
@RequestParameter
| Long entityId;
|
| public void removeMyEntity() {
| MyEntity mySelectedEntity = em.find(MyEntity.class, entityId);
| em.remove(mySelectedEntity);
| }
Is it as simple as an h:commandLink to the action method with a nested f:param
that has the id of the entity?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4010560#4010560
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4010560
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user