• 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

Server side validation of inputText

 
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe try to use:

instead of
 
S Majumder
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks all of you for your's valuable posts
 
reply
    Bookmark Topic Watch Topic
  • New Topic