• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 82
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 82
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Looky! I'm being abducted by space aliens! Me and this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic