• Post Reply Bookmark Topic Watch Topic
  • New Topic

Primefaces datatable: row selection not works, selected row is null

 
daniele licitra
Ranch Hand
Posts: 81
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to all.
I've a datatable defined in a bean and when I select a row, the related variable is not updated.

the page code is


and "tabellaFK" is defined in sessioneUtente (is a session scooped CDI bean) and initialized in this method:


the selected value must be saved in "bean.fkselezionata".
I've getter and setter defined in bean, but when the action "rowselect" is thrown, the method
setFkselezionata(Entity x){ this.fkselezionata = x};
has x=null !

fkselezionata is an entity and has an "id" field. i've tried to set
rowKey="#{fkrecord.id}" or rowKey="#{fkrecord.getField(0)}"
in datatable but the result is the same. The variable x is always null!

The same result is obtained also for rowDblselect ajax action :(
 
daniele licitra
Ranch Hand
Posts: 81
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, the problem is in the dialog.
With appendToBody="true", the dialog is written appended to the body, outside the form.

But modal="true" require appendToBody, so I used this trick:



The dialog event activate/deactivate the block ui :)

Now it works.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!