• 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

Get the selected row in datatable [PRIMEFACES]

 
Greenhorn
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.

Regards,
Brendan.
 
reply
    Bookmark Topic Watch Topic
  • New Topic