• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Submit dataTable fields

 
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello. I have a dataTable and I wish to submit the values.

But none of the dataTable values are submited, how should I do?

Would I have to write a dataTable instead of just giving the collection to the component? ( I saw this idea here https://coderanch.com/t/506763/JSF/java/multiple-selectOneMenu-values-inside-dataTable#2288586 )

I am using Primefaces with Mojara 2.04 and Glassfish.

Here it is the code of my dataTable:


Is there another way? Or I will have to the dataTable writed by myself?
 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have a similar question
my table looks like


it works perfectly fine with the f:setPropertyActionListener tag but what if i wanted to pass a qty of the item to add that has to be obtained from the field...

sadly i dont think you can put multiple h:form tags w/in the same datatable...
 
Saloon Keeper
Posts: 23274
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hebert - you need a dataModel to decorate your row data with the cursor constructs needed to enumerate the rows in the table. That's why you can't bind the collection directly to the dataTable control.

Christopher - When you fire an action processor using a commandButton or commandLink on a row in a dataTable, you can find out which row was fired using the datamodel methods "getRowData()" and "getRowNumber()" - assuming I haven't remembered their names wrong. Again.

You can do forms inside a dataTable, but they have to obey standard XML tag/endtag matching rules. So you could wrap a form around a single column's items, for example. However, that's a bit much for most of us.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Tim Holloway
Thanks for you reply.

I googled trying to find some tutorial with dataModel and I could not find It, yet.

Do you have any tutorial? Or link to indicate?

Thanks! [=
 
Tim Holloway
Saloon Keeper
Posts: 23274
158
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's an old series of articles, but it's still relevant, and it really helped me when I was getting started. Google IBM Developerworks series "JSF For Nonbelievers" by Rick Hightower. He has a good example of a table/detail application.
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your time. I will go for it.
 
I've been selected to go to the moon! All thanks to this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic