aspose file tools*
The moose likes JSF and the fly likes  Server side validation of inputText    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark " Server side validation of inputText    " Watch " Server side validation of inputText    " New topic
Author

Server side validation of inputText

S Majumder
Ranch Hand

Joined: Jun 03, 2009
Posts: 244
Hi everybody ,
I am creating 4 inputText (<h:inputText>) dynamically by using <c:forEach> .
I want to validate each field (each fields should be mandatory ) . I am not able to do it.

Here is my jsf code :



Here is my backing bean code :

I have taken "infoList" as an List<SelectItem>



My problem :
I am not able to print the message in the jsf , because I am not getting the id of inputText .Is there any other way to solve this problem ?

please help .

thanks & regards ,
S
Tomasz Lipinski
Greenhorn

Joined: Nov 05, 2008
Posts: 6
Hi,
Instead of c:forEach use h:dataTable with one h:column. dataTable will automaticaly assign ids like tableId:0:inputId, tableId:1:inputId etc. h:message tags will then correspond to proper inputTexts.
Robert Filipczyk
Greenhorn

Joined: Jun 24, 2009
Posts: 4
Maybe try to use:

instead of


Darmowe Ogłoszenia
S Majumder
Ranch Hand

Joined: Jun 03, 2009
Posts: 244
Thanks all of you for your's valuable posts
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Server side validation of inputText
 
Similar Threads
JSF SelectOneRadio and inputText
How to bind data in inputText field
Problem in populating textbox in jsf on clicking submit button
Enable dynamic inputText
Apache Commons Validator: Working With Arrays