Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

h:dataTable and h:inputText problem  RSS feed

 
Priti Shah
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have one dataTable which contains inputText fields in one of its column. Now I want to get values of inputText in my bean. How do I get these values in my bean?

When I see html output of the page IDs generated for inputText is something like this

formID ataTableID:**:inputTextID where ** is the number generated by JSF.

So I donot understand how to get it from requestParameter Map. Is this the only way or Is there any other way of doing this?

Thanks
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My code in this thread is doing that. Most JSF tutorials will have similar examples.
 
Naveen Mishra
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeff,

I've been using

JsfHelper.getParameter("formID:inputtextID");

to get value of the form elements .



as per my analysis, this is working fine.
Is there any drawback or efficiency issue with this ??

Jeff , pls , reply.

Thanks.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can do that, but you're bypassing much of the power of the JSF
framework. Why aren't you binding it to a property of a backing bean?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!