Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Get the selected row in datatable [PRIMEFACES]

Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys, i'm not managing to get the selected row from my datatable. I tried to do like the example in the showcase (link here) but I may be missing some tiny detail.

Here's the xhtml:

Here's the code from my bean:

in my onRowSelect I ask it to show me the attribute numOs from the current selected row in the dialog, but nothing is shown.
in the console nothing appears either, not even a null value. I debugged the project, but couldn't discovery anything as well.

I appreciate any help, thanks a lot
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Firstly I think you're trying to do too much in one go. Unfortunately it never works with this
infrastructure and is difficult to debug.

Having said that you want to be using view scoped beans with primefaces. Request scoped
beans don't work well with ajax, and most primefaces components are ajax enabled by
default. Are your imports correct? if, for example, you've imported
javax.annoation.ManagedBean then unless you're intentionally using CDI, you've got the
wrong package, but it's not apparent because you've not included the imports in your post.

I would suggest getting rid of the code for the dialog temporarily as dialogs are tricky so
remove onRowSelectComplete. Use <ui:remove> </ui:remove> to take out all but one of
the columns and see if that helps.

Are there any javascript errors on the page? (in internet explorer, depending on settings,
a yellow ! warning icon on bottom left of screen), or anything in the server log.

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic